Double Jump Help
hrsmedia
Member Posts: 522
I'm trying to do a double jump using 1 button. I can only get it to work using 2 separate buttons.
1 button to jump
1 button to jump while in air
This is what I'm doing...
(INSIDE THE ACTOR)
if actor collide with platform
change attribute game.DoubleJUMPReady to false
otherwise change attribute game.DoubleJUMPReady to true
(INSIDE DOUBLE JUMP BUTTON)
if touch pressed and game.DoubleJUMPReady is true
change attribute game.DoubleJUMP to true
after 0.1 sec (RTC checked) change attribute game.DoubleJUMPReady to false
otherwise change attribute game.DoubleJUMP to false
1 button to jump
1 button to jump while in air
This is what I'm doing...
(INSIDE THE ACTOR)
if actor collide with platform
change attribute game.DoubleJUMPReady to false
otherwise change attribute game.DoubleJUMPReady to true
(INSIDE DOUBLE JUMP BUTTON)
if touch pressed and game.DoubleJUMPReady is true
change attribute game.DoubleJUMP to true
after 0.1 sec (RTC checked) change attribute game.DoubleJUMPReady to false
otherwise change attribute game.DoubleJUMP to false
Comments
Then, whenever your actor collides with your ground actor, just set bumps to 2
whenever you press the button, add the rule if Jumps > 0
-self.LinearVelocity.Y = 500 or *however you're getting your actor to jump*
-jumps = jumps - 1;
Let me know if this helps!
@kirk1234 - I'll take a quick look for you. Email me (games at hrsmedia.com)