how to pause an animating actor when touched?

KangavarkKangavark Member Posts: 62
edited August 2012 in Working with GS (Mac)
hey gang,
I have an actor on a looping animation, and I'd like it to freeze upon touch, but I'm not sure how to do this since there's not a "stop animation" behavior.

any tips?
thanks much!

Comments

  • Barking_AppsBarking_Apps Member Posts: 182
    create an self.attribute (boolean (call it animate)) when touch is pressed change self.animate to false! otherwise self.attribute = true!

    create rule:
    when self.animate is true (add animation rule)

    this should do the job! #:-S
  • KangavarkKangavark Member Posts: 62
    create an self.attribute (boolean (call it animate)) when touch is pressed change self.animate to false! otherwise self.attribute = true!

    create rule:
    when self.animate is true (add animation rule)

    this should do the job! #:-S
    Thanks--it works--but now I realize I need to rephrase my question:
    How can I make the actor stay frozen upon touch? As it is now, with your help, the actor freezes upon touch, but resumes animation upon release. I'd like it to stay frozen after release, and unfreeze when it is touched again.
  • 921creative921creative Member, PRO Posts: 140
    Have an integer attribute called whichtouch.

    Make a rule that when the actor is touched, AND whichtouch is NOT equal to 1, change whichtouch to 1.

    Make another rule for when the actor is touched AND whichtouch = 1, change whichtouch to 2.

    Make a rule that when whichtouch is equal to 1, set self.animate to false / otherwise set self.animate to true.
  • KangavarkKangavark Member Posts: 62
    Have an integer attribute called whichtouch.
    Is that attribute for the actor or for the 'game'?
Sign In or Register to comment.