Help with JUMP!
eliehang
Member, PRO Posts: 105
So I've been testing and researching on how to make a slightly perfect jump. I looked into the basic platform test and also the wiki, but there's some things I don't understand. such as boolean attributes or where self.Inity -- self.position -- self.ZeroTime come from? Has anyone successfully made a good jump yet?
Comments
I've got gravity set at 300.
left and rigth movements are normal, but when you hit space, the player accelerates upward at 600 for 1 second. that simulates a jump. after 1 second, the player is dragged back down by gravity.
there are probably better ways to do it, but it works for me.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
Looking at the platformer template gives you a great head start to using jump
If you do have gravity in a scene, then using accelerate to jump is good, that way, as mulcahy said, gravity brings you back down
I believe the platformer template has some boolean attribute in there too, like selfontheground but double check that
Create invisible actors to use as a floor.
Create a boolean actor called jump (or whatever)
in your jumper create some rules:
1) When jumper collides with floor change jump attribute to true
2)When space is down AND jump=true
jump behaviors - see wiki (basically accelerate 90 with a timer)
change jump to false (this keeps you from being able to press the jump key over and over again to fly)
That way when you land jump attribute will change to true and you will be able to jump again.