Platformer Help

shebhntshebhnt Member Posts: 74
edited January 2012 in Working with GS (Mac)
Hey guys! So after a long break from developing (thanks to lots of curveballs from life) I am getting back into the game. I am working on a simple plat former and right now just trying to get the controls/jumping/etc perfect. I am facing a bit of an issue though. Right now I have it set up so that when the jump button is held longer you jump higher. To do this, I temporarily turn off my gravity rule for a limited amount of time then it turns back on whether you held it down or didn't after .2 seconds.

The issue is that if I hit the jump button very quickly it can continually jump as long as you can hit it again before the .2 seconds.

Now the timer that is activated has run to completion checked, and currently the way the rule works is that it looks to see if a variable "jumps" is set to 1 (I did this to eventually add double jump). If the button is pressed and jumps is at least at 1 then it turns off gravity, changes the y velocity, then starts the timer which will subtract 1 from jumps. So when Jumps hits 0 the otherwise part of the rule should take effect and cause gravity to turn back on.

Like I said, it works but for some reason if you spam the jump button quick enough it seems to reset the timer. Any ideas?

Comments

Sign In or Register to comment.