Help with using touch count

ChobbifaceChobbiface PRO Posts: 491
edited November -1 in Working with GS (Mac)
My brain is a bit stuck at the moment, and would greatly appreciate some input :). Is it possible to use the same touch count to start and stop something?

To explain, at the moment I'm using when touch count = 2, start animation. However, I want the user to be able to stop the animation when they want later, using the same 2 finger tap i.e. touch count 2. Have been fiddling about with some attributes, but cant seem to get it to work. Can get it to start the animation with a 2 finger tap, but not stop the animation with a 2 finger tap later.

Thanks in advance

CB

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Add in an integer game attribute called animate

    Then make your rule

    When touch count = 2
    Change attribute game.animate to (game.animate + 1)%2

    Then make your animate run when game.animate is equal to 1

    The rule will just flip back and forth between 0 and 1

    Good luck.
  • ChobbifaceChobbiface PRO Posts: 491
    That worked like a charm, and I just learnt something new. Thanks a lot, much appreciated!
Sign In or Register to comment.