Re: Player related stuff, need help.
Ok, that was a different way to do jumping, try this.
int jumptime=100; //the player will rise every 100 m/s.
timer jumptimer;
int ty1,ty2;
bool jumping=false;
bool ascending=false;
//now for jumping code
if(key_pressed(KEY_UP) and jumping==false) { jumping==true; ascending==true; spool.play_stationary("jump.ogg",false); ty=y; ty2=y+5; } if(jumping==true) { if(ascending==true and jumptimer.elapsed>=jumptime) { jumptimer.restart(); y++; spool.update_listener_1d("y"); } if(y>=ty2) { ascending=false; } if(ascending==false and jumptimer.elapsed>=jumptime) { jumptimer.restart(); y-=1; spool.update_listener_1d("y"); } if(y<=ty1 and ascending==false) { y=ty1; jumping=false; spool.update_listener_1d("y"); p.play_stationary("land.ogg",false); } }
That'll need some polishing and messing with to fit your game, but ask if you have any more questions.
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector