I want the parashooter in this game (attached) to jump when I press space ONCE, I don’t want to hold in space all the time as you would understand, here is the code for the parashooter:
onClipEvent(load){
speedx = 0;
time = getTimer();
time /= 100;
speedystart = 0;
}
onClipEvent(enterFrame){
lufthast = _root.luftskepp._x/200;
timenow = getTimer();
timenow /= 1000;
speedy = 9.82 * (timenow - time) + speedystart;
if(Key.isDown(Key.SPACE)){
this._y += speedy/5;
this._x += speedx + lufthast;
if(_y >= 700){
_y = 700;
_root.fallskarm.stop();
this._x -= speedx + lufthast;
}else{
if(Key.isDown(Key.LEFT)){
_x += 3;
}
if(Key.isDown(Key.RIGHT)){
_x -= 3;
}
}
}else{
this._x = _root.luftskepp._x;
this._y = _root.luftskepp._y + 100;
}
}