Jumping in Flash
How can I make a character jump in the scene and back to the floor by gavity?
if (Key.isDown(81) and jumping==0) {
jumping = 1;
starttime = getTimer()/1000;
startpos = _y;
}
if ( jumping==1) {
time = getTimer()/1000-starttime;
_y = _y-(startspeed-gravity*time);
if (_y>startpos) {
_y = startpos;
jumping = 0;
}
}
I use something like this script. The character can jump up but he will only jump up 1 pixel. I should continue to press jump button many times and then he will jump continuely.
any help is appreciate
Attachments:
trial.zip
12.93 Kb, 104 views
Last edited by Ahmult, May 7th, 2006 01:11 PM (Edited 1 times)
