**HELP WITH JUMPING**

I tried making an actor jump with gravity (accelerating down) and changing the linear velocity Y, but the user can still press the jump button and continue to jump upward. I need to make it so that the actor can jump a max of 2 times (and I would also, if anyobdy knows how to, be able to change the max number of jumps to 3 or 4 easily if necessary). I also have the ability for the actor to move left and right, and when the actor is falling down from the jump the actor does not continue to fall but simply moves straight to the left or right, depending on which button you are pressing for the direction the actor will go. If anyone could help me with both or one of these things I would greatly appreciate. Any advice or even the code in GS to do it would be superb. If you need any other information to help me like screenshots or anything just let me know. Thanks!

Comments

  • LooseMooseLooseMoose Member Posts: 224
    edited November 2012
    To apply a double jump rule create an integer called 'jump' and leave it at 0


    Create this rule in your jump button:
    When 'Jump button' receives touch, change attribute 'jump' to 'jump + 1'

    In your hero create these rules:
    When any of the following are happening:
    If attribute 'jump' = 1
    If attribute 'jump' = 2

    Do:
    Change velocity to 'x' in direction 90


    Put another rule in your hero:
    When hero overlaps with ground change attribute 'jump' to 0


    I hope that can help you figure out your double jump. Good luck
  • Thanks guys. I'll try the video and the the tutorial from kyukon and will let you know if I have any issues. Thanks.
  • ShackShackShackShack Member Posts: 1
    edited March 2013
    To apply a double jump rule create an integer called 'jump' and leave it at 0


    Create this rule in your jump button:
    When 'Jump button' receives touch, change attribute 'jump' to 'jump + 1'

    In your hero create these rules:
    When any of the following are happening:
    If attribute 'jump' = 1
    If attribute 'jump' = 2

    Do:
    Change velocity to 'x' in direction 90


    Put another rule in your hero:
    When hero overlaps with ground change attribute 'jump' to 0


    I hope that can help you figure out your double jump. Good luck
    Hey Kyukon, this was very helpful for making the hero jump, but it doesn't allow it to jump twice. I can jump once in the air, and once off of a platform. Any idea what else I might need? Thanks!

    EDIT: nvm, I actually found another way to do it that was very similar to yours. Thank you anyway!
Sign In or Register to comment.