can one actor be touch and cancel another actor?

app-etiteapp-etite Member Posts: 139
edited November -1 in Tech Support
hi,

I have two buttons. one button for small jump, one button for higher jump.

when either jump button is pressed i can also press the other jump button after to make him double jump, which is not what I wont.

how do I get...when this button is pressed then you cant press the other until he reaches the ground again, like a real human would?

any ideas.

Thanks

Comments

  • GamersRejoiceGamersRejoice Member Posts: 817
    you'll need an attribute called jump or something. Add +1 to that attribute when you hit the jump button, and then make a rule that says jump only if jump attribute is equal or less than 2. when actor hits the ground reset the jump attribute back to 0. Hopefully that makes sense, I'm not good at explaining things.
  • MotherHooseMotherHoose Member Posts: 2,456
    amother way is to have a boolean game.Attribute called inJump or whatever...

    on Buttons Rule (All) when
    +touch is pressed
    +Attribute game.inJump = false
    --changeAttribute game.inJump To: true
    --do this (your jump height)

    either a timer or another rule for when jump is completed to changeAttribute game.inJump To: false

    MH
  • app-etiteapp-etite Member Posts: 139
    Hey MH

    I got it all up to..

    --do this(your jump height) .... Is that a change attribute or....?

    And why do I need the jump height in there? Can you explain what all this is doing so I understand it more.

    Thanks mate

    -app-etite
  • MotherHooseMotherHoose Member Posts: 2,456
    sorry I meant -
    -- do this ... that is do whatever you do to make the jump...
    that just means... you put what you code for the jump in this place to have actor jump
    ...changeAttribute self.Position.Y or Interpolate self.Position.. or whatever

    MH
  • app-etiteapp-etite Member Posts: 139
    im sure im doing exactly what you've told me but it isn't working.. still double jumping. : (
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    If im understanding correctly try this. Have a attriubte called jump lock. Have a rule in the player when actor collides with ground change jump lock to 0, then in the otherwise section of that rule change jump lock to 1. And then in your jump buttons just put everything in a rule that says when jump lock is 0

    wat its doing is everytime ur on the ground the attributes zero, then when you jump it changes to 1 and since you can only jump when jump lock is 0 (since you put all the jump rules for each button in a rule when jum lock is 0) when he jumpps youll have to wait till he lands to jump again

    cheers
  • app-etiteapp-etite Member Posts: 139
    That hasnt worked... :( thought it would. Ive uploaded some screenshots.

    can you take a look please?

    screenshot of rules in actor (my character)

    image

    screenshot of rules for jump.

    image

    screenshot for higher jump higher

    image

    Thanks

    app-etite games
  • souzarafaelsouzarafael Member Posts: 2
    You're missing the rule of checking if the actor is jumping. It should look like:

    - When all conditions are valid:
    Actor receives event touch is released
    Attribute game.stop.jump = false

    It will solve your problem. ;)
Sign In or Register to comment.