Betawar,
Im trying to get my character to jump ONLY when you press Up.
I DONT want the player to be able to "bounce" the character by HOLDING up.
This is currently my jump code.
CODE
//Up Arrow
if (Key.isDown(38) && _root.ground.hitTest(_x, _y+3, true)) {
// Press W to jump ONLY when touching ground.
grav = -jumpHeight;
// makes gravity negative jumpheight, causes jump
_y -= 4;
// makes the y go up by 4
this.gotoAndStop(2);
// Enter Jump stance.
}
Im getting frustrated because I set the game up to allow only single jumping at first ( with a fuel bar ), then upgrade to allow double jumping/triple jumping.
I can't seem to do it with Up Arrow tho. If I press Up arrow, not only will he jump, he'll deplete the fuel tank because onClipEvent(enterFrame) registers the keys being down WAY too fast. I want the character to have to single hit Up to jump once and only once.
To fix this problem with the depletion of fuel without getting a double jump, I have made A the double jump button ( only usable in air ). How do I make it work with one button? I already tried an if statement inside an if statement, it still registers 2 presses of Up arrow in like .000005 of a second.
heres an example.
http://www.spotlightcontest.com/adventure.htmlplease note that you can only double jump once ( with A ) once now because the fuel system IS working