How to not have an actor be able to jump in mid air

OK well i need to know how to make my actor not be able to jump in mid air. I have integers so that when my actor that jumps is grounded he can not jump it looks like this.
when actor collides with actor of type Platform set game jump to 0 (no jumping)
when the actor finishes a jump and lands on the platform he can still jump even after the platform ends eg; in mid air
Thanks to anyone who helps :)

Answers

  • Bilal15Bilal15 Member Posts: 35
    edited November 2012
    ok lets see if i can help

    first you dont need any attributes for this all you need is a rule and gravity

    (single jump)

    rule=when actor collides with platform and when touch is pressed

    then in the rule have: change attribute of self.position y to self.position y +100

    (The 100 is just the height of the jump,change it to anything you want higher the number the higher actor jumps)

    To create gravity for an individual actor all you have to do is put an acceleration behaviour into the actor and set it to 180 and speed to how strong you want the gravity.

    Note: Without gravity the actor will just hover in mid air and do nothing

    If you still need help send me a email and i will try my best to help you with your app.

    Bilzo99@gmail.com

    Hope i helped

    Bilal
  • mrpacogpmrpacogp Member Posts: 400
    edited November 2012
    I have tested linear velocity not 0, then cant jump
    or, when jump set attribute to jumping, then if attribute is jumping, cant jump :P
Sign In or Register to comment.