Double tap

IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
edited November -1 in Working with GS (Mac)
Hello, I have an actor with a rule, and I would like to make something like that:
1. Player taps with his finger on this actor.
2. Some action starts.
3. Player taps for the second time on the this actor.
4. Action stops.

I have a rule, which requires a tap with a finger, and attribute to be set on 0. It starts an action and changes this attribute to 1.
And a second rule, which requires a tap with a finger, and attribute to be set on 1. It makes an action stops and changes this attribute to 0.

It doesn't work in GS preview. I think, because of: actor recognizes my tap, and changes an attribute to 1, and then a second rule is occuring. But I have no idea, how to make it differet. Could you give me some advice? Thank you.

Comments

  • ShpintShpint Member Posts: 404
    Try this
    "When all is apply"
    -When touch is press
    -Attribute (xxx) = 0

    ---Change Attribute (xxx) to 1
    ---Action Start

    and

    "When all is apply"
    -When touch is press
    -Attribute (xxx) = 1

    ---Change Attribute (xxx) to 0
    ---Stop Action

    Hope that helps
  • quantumsheepquantumsheep Member Posts: 8,188
    tshirtbooth said:
    Nope do this

    When touch is presses change game.???? To (game.???+1)%2

    This will change from 0 to 1 and when it's 1 to 0

    No need for 2 rules.

    Cheers.

    One of the best tips ever right there - you can change the %2 to %3, or %4 for more states to flick between.

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • ShpintShpint Member Posts: 404
    WOW!!! didn't know that!!
    Thanks alot tshirtbooth :)

    Can you explain a little bit more??
  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    Hello, Thank you for the replies.
    I have something like that:
    "When all is apply"
    -When touch is press

    ---Change Attribute game.Inventory to: (game.Inventory+1)%2"

    The second actor:

    "When all is apply"
    -Attribute game.Inventory = 0

    ---Action Start

    and

    "When all is apply"
    -Attribute game.Inventory = 1

    ---Second Action Start"

    But it doesn't work in the GS preview.
  • PhoticsPhotics Member Posts: 4,172
    This thread title reminds me of Zombieland. I saw that last night... good movie!
Sign In or Register to comment.