Jumping in bgt?

I'm trying to make a little game thing for myself, and I want jumping, but i'm having difficulties.

I wasn't sure how to aproach this, so I decided, hey, let's  try to convert Mason's jumping code from his open source projects into 3d.
There were prior changes by myself as well, to make a few parts of the thing act differently.
But for some reason, it won't jump.
Here is the jumping segment, tell me if you need more information. Maybe you can help?: Also, if you could help me with not letting my steps play when I walk off and edge?

void game()
P
while(true)
{
if (key_pressed(KEY_SPACE) and jumping==false and key_up(KEY_G) and jumpstuntimer.elapsed>=jumpstuntime)
{
p.play_stationary("sounds/jump.ogg",false);
ty1=me.z;
ty2=me.z+jumpheight;
jumping==true;
ascending==true;
jumpstuntimer.restart();
}
if (jumping==true)
{
if (atapex==true and jumptimer.elapsed>=apextime)
{
jumptimer.restart();
atapex==false;
}
if (ascending==false and jumptimer.elapsed>=jumptime2 and atapex==false)
{
jumptimer.restart();
me.z-=1;
checkforplatforms();
if (me.z<=ty1)
{
me.z=ty1;
p.play_stationary("sounds/land.ogg",false);
jumping==false;
}
}
if (ascending==true and jumptimer.elapsed>=jumptime)
{
jumptimer.restart();
me.z++;
checkforwalls();
if (me.z>=ty2)
{
ascending==false;
jumptimer.restart();
atapex==true;
}
}
}
if(me.x<0)
{
me.x=0;
}
else if(me.x>maxx)
{
me.x=maxx;
}
else if(me.y<0)
{
me.y=0;
}
else if(me.y>maxy)
{
me.y=maxy;
}
if(key_pressed(KEY_C))
{
speak(""+me.x+", "+me.y+", "+me.z+"");
}
if(jumping==false)
{
movetime=walkspeed;
}
else if(jumping==true)
{
movetime=airspeed;
}
if(key_down(KEY_UP) and movetimer.elapsed>=movetime)
{
move(1);
}
else if(key_down(KEY_RIGHT) and movetimer.elapsed>=movetime)
{
move(2);
}
else if(key_down(KEY_DOWN) and movetimer.elapsed>=movetime)
{
move(3);
}
else if(key_down(KEY_LEFT) and movetimer.elapsed>=movetime)
{
move(4);
}
if(key_pressed(KEY_ESCAPE))
{
p.destroy_all();
mainmenu();
}
}
wait(5);
}
void move(int dir)
{
movetimer.restart();
if(me.z==0)
{
p.play_stationary("sounds/step"+random(1,5)+".ogg",false);
}
if(dir==1)
{
me.y++;
}
else if(dir==2)
{
me.x++;
}
else if(dir==3)
{
me.y-=1;
}
else if(dir==4)
{
me.x-=1;
}
}


-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ogomez92 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ogomez92 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ogomez92 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : kianoosh via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ogomez92 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector

Reply via email to