Fangames > Programming Questions
Infinite Jump?
(1/1)
kilgour22:
Anyone able to help with how to code a proper infinite jump? Any help would be much appreciated!
lemonxreaper:
it is quite simple to get this working.
Create an object, call it InfJump or whatever you want.
you dont need to give it a sprite or anything like that.
in the step event of this object add:
with(player){djump = true}
then just place this object in the room you want to have inf jump or have it created or destroyed by another object.
There are other ways that are perhaps more efficient but really it doesn't matter that much and such ways are more complicated.
klazen108:
That is definitely the simplest way and the added overhead of setting an additional variable every step is really negligible. I know the Nekoron Engine defaults to having a screen-sized sprite and on collision with player does with(other)djump=true; but that is even less efficient than just setting the variable every step.
I guess the most optimized way to do it would to add a global variable to the playerJump script, that allows you to double jump if djump==true OR if global.infJump==true, and just set that true/false as needed. But assuming your game isn't tottering on the edge of crashing, just setting djump=1 every step will work just fine :Kappa:
Navigation
[0] Message Index
Go to full version