Double Jump Help

hrsmediahrsmedia Member Posts: 522
edited November -1 in Working with GS (Mac)
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

Comments

  • 777ideas.com777ideas.com Member, PRO Posts: 895
    hrsmedia said:
    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

    Hey can you help me with adding a high score to a doodle jump game.

    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

  • 777ideas.com777ideas.com Member, PRO Posts: 895
    Hey can you help me with adding a high score to a doodle jump game.
  • 777ideas.com777ideas.com Member, PRO Posts: 895
    I was referred to you by a guy you helped with a high score
  • ToastKittenToastKitten Member Posts: 360
    Make an integer variable called "Jumps"

    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!
  • hrsmediahrsmedia Member Posts: 522
    @ToastKitten - Thanks that's a good method, I appreciate it.

    @kirk1234 - I'll take a quick look for you. Email me (games at hrsmedia.com)
  • 777ideas.com777ideas.com Member, PRO Posts: 895
    I will email you right now, Thank You So Much.
  • 777ideas.com777ideas.com Member, PRO Posts: 895
    Email sent I even attached my file
Sign In or Register to comment.