I am trying to learn how to use this software, but I am totally new to programming, 3D modeling and everything else I am trying to do. In order to understand, I need to make a game myself. Otherwise, I won’t remember anything. I am trying to make a 2D game that will sort pictures. (It is for my autistic son who learns visually and of course, loves video games. I am hoping to be able to modify it for vocabulary he needs to learn for school.) So far, I made bitmaps for solid, liquid and gas. I used the button code from the workshop #6 that shuts down the engine, but I took the shutdown part out and replaced it with making a sound. The odd thing is I only the gas button worked. Here is the code I was using:
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////
BMAP* cursor_pcx = "cursor.pcx";
BMAP* apple_bmp = "apple.bmp";
///////////////////////////////
SOUND* beep1_wav = "beep1.wav";
SOUND* beep2_wav = "beep2.wav";
SOUND* goal_wav = "gotkey.wav";
///////////////////////////////
function main( )
{
video_screen = 1;
video_mode = 7;
screen_color.blue = 150;
}
///////////////////////////////
function mouse_startup()
{
mouse_mode = 2; //show the mouse curser
mouse_map = cursor_pcx; // set the mouse pointer bitmap
while (1)
{
vec_set(mouse_pos, mouse_cursor);
wait(1);
}
}
///////////////////////////////
function mouse_event()
{
if (event_type == EVENT_CLICK)
{
snd_play(beep1_wav,100,0);
}
}
action sound_on_click()
{
my.emask |= ENABLE_CLICK;
my.event = mouse_event;
}
///////////////////////////////
PANEL* solid_pan = // solid
{
button(125, 50, "solidred.bmp", "solidnorm.bmp", "solidyellow.bmp", mouse_event, NULL, NULL);
flags = OVERLAY | SHOW;
}
///////////////////////////////
PANEL* liquid_pan = // liquid
{
button(310, 50, "liquidred.bmp", "liquidnorm.bmp", "liquidyellow.bmp", mouse_event, NULL, NULL);
flags = OVERLAY | SHOW;
}
///////////////////////////////
PANEL* gas_pan = // gas
{
button(500, 50, "gasred.bmp", "gasnorm.bmp", "gasyellow.bmp", mouse_event, NULL, NULL);
flags = OVERLAY | SHOW;
}
///////////////////////////////
After much research and reading and trying different things, I called in my husband and son who know a lot more than I do about computers. The moved things around and tried different things. When they switched the x and y coordinates on the liquid and gas panels then liquid and gas worked, but not solid. What finally worked was putting gas at x=125 and y=50, liquid at x=310 and y=50, and solid at x=500 and y=50. Why didn’t it work before or only partly until they were in that order? The only thing I can think of is that they need to be in alphabetical order but that doesn’t make sense to me. Why would the computer care? I need to understand so I won’t make the same mistake when I modify the program for other categories.
Thank you for your explanations in advance. If I posted in the wrong place. Sorry. I really am new so I thought I would start in the beginner forum.
rpframe