Reset Variables after Animation?

MADGamesMADGames Member Posts: 12
edited July 2012 in Working with GS (Mac)
Hi forum,

Just a quick question cos I've been racking my brain over this.
In my game, I "count" how many swipes the user does then when it hits 5, an animation occurs. To do this I made an attribute called "SwipeCount" and everytime a swipe was registered, it increased SwipeCount by 1.
When SwipeCount = 5, the animation plays. But how do I make the variable go back to 0 so after another 5 swipes, the animation plays again?

Things I've tried:
When SwipeCount = 5, Animate, SwipeCount = 0
When SwipeCount = 5, Animate, Timer 0.1 Second, SwipeCount = 0
When SwipeCount = 5, Animate, Change Attribute "SwipeReset" (boolean) to true. When SwipeReset = true, Change Atrribute SwipeCount = 0

Any ideas?

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    @MADGames

    Strange that none of those Change Attribute behaviours are getting through...

    Maybe try:

    When SwipeCount = 5
    Animate
    Timer: After ----length of time of animation
    Change Attribute SwipeCount to 0

    or:

    When SwipeCount = 5
    Change Attribute SwipeCount to 0
    Animate
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    In the rule where the animation is put a change attribute change swipe count to zero after the animate behavior in the rule.
Sign In or Register to comment.