Re: help in bgt?
Ok, so, you could use ectors, or as lucas said, int x, y, z;
Maybe something along the lines of this. This code wouldn't work correctly but screw off.
int x, y, z; //the players coordinates.
int jumping; //we'll just have this here in case you wanta make jumping;
//declare some sounds
sound step; sound jump; sound ambience;
void main() //hope I don't gotta explain this.
{
//load the sounds.
step.load("step.ogg");
jump.load("jump.ogg");
//etc.
ambience.play_looped();
while(key_pressed(KEY_ESCAPE)=false) //Declare that the following will occur if the key escape is pressed.
{
if(key_pressed(KEY_UP))
{
move(forward); //call the move void, with the directcion of forward.
}
//do that for all the arrows.
}
if(key_pressed(KEY_ESCAPE))
{
exit();
}
}
void move(string direction) //call a move function, that will take the direction that you move.
{
step.play();
if(direction=forward)
{
y++;
}
//etc.
}
Now that was thrown together in 5 minutes, and I don't even think that would work, considering I have a vary limited grasp on loops, for some reason they won't work for me, and that I'm not sure if I did the void with an enclosed var correctly. Please correct me if I did that rong, cause I'd love to learn myself.
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector