Problem with actor (jump) help!!

Hi!
I have this problem, when I configured my actor, my settings was a rule that say this:
Press "space" change attribute to 200 and otherwise the same to 0. But the problem is, if I repeat space space space.... my actor do double and triple jump. I want that only possible one jump and after when the actor down... can jump, but not in the air!!!!

How can solvent?

Thanks thanks in advance!!!

Comments

  • SingleSparqSingleSparq Member Posts: 1,339
    Only allow him to jump if he's touching the ground.
  • aitorv21aitorv21 Member Posts: 71
    no, when I press "space" my actor jump one time, but if I repeat while is jumping, the actor back to jump. How can solvent? Thanks in advance!
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    Add a Boolean attribute (let's say it's called game.jumping) that you set as true when you press the space bar and set as false once it lands. Then on your space bar rule say if space bar is pressed and game.jumping = false
  • SingleSparqSingleSparq Member Posts: 1,339
    If your rule is set to if colliding with ground then allow the jump rule it won't jump on repeating presses unless you are touching the ground.
  • aitorv21aitorv21 Member Posts: 71
    thanks kevin, I do these, now is of this form:
    http://i42.tinypic.com/20huia9.png

    Now, what have to do?
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    If you're putting the attribute on the actor you can remove the game. bit from the name. You're close you need to set it as true inside your rule where you're currently saying false, and on the rule, below the space bar bit say if attribute self.jumping = false.

    What you then need to do is make sure you set self.jumping to false when it lands on something.
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    If you look at the templates that come with GameSalad you'll see a basic platformer template that has jumping in it. Look to see how that one works
  • aitorv21aitorv21 Member Posts: 71
    ok kevin!! im solved the problem when saw the platformer template. Thank you very much!!!
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    You're welcome!
  • aitorv21aitorv21 Member Posts: 71
    edited October 2013
    thanks also to singlesparq!!!
  • SingleSparqSingleSparq Member Posts: 1,339
    Yay me! Nonprob.
Sign In or Register to comment.