I am having real trouble with a game I am making. I have a power-up which you collect, which allows you to do a double jump, but you can only do one double jump. I just can't get it to work. If you are going to help me, then remember that you can only do one double jump each time you collect the power-up.
Any help would be appreciated.
Offline
Make a variable called (double jump) no parentheses. Then when the sprite collects the power up, set it to one. Then you need a script for the double jumping that activates when the variable is equal to 1. After the jumping motion on the same script, add a set double jump to 0. That should work...
Hope it helps!
Offline
fg123 wrote:
Make a variable called (double jump) no parentheses. Then when the sprite collects the power up, set it to one. Then you need a script for the double jumping that activates when the variable is equal to 1. After the jumping motion on the same script, add a set double jump to 0. That should work...
Hope it helps!
That is pretty much what I've been trying, except I just have a variable called 'jump', that works normally when the power-up is not collected, by changing to 1 when it is in the air, and back to 0 when it touches the ground. But when the power-up is collected, is does that, but if you press the up button while 'jump' is 1, it sets it to 2, and jumps again, but this doesn't work, I'll try your way.
Offline