GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

dont touchhh again again again... :(

cercan57cercan57 Posts: 6Member, PRO

I want to animate when I click once but disappear after 0.2 seconds. that actor must never be touched again... not allowed to touch. I want it to be closed when I click a few times. can you help?

Comments

  • tatiangtatiang Posts: 11,401Member, Sous Chef, PRO, Senior Sous-Chef

    Make a boolean called self.Touched. It should be false (unchecked) to start with.

    When touch is pressed
         Change attribute self.Touched to true

    When attribute self.Touched is true
         Animate
         Timer after 0.2 seconds
              Change Attribute self.color.Alpha to 0
         

    What does it mean to "close" an actor? And how many times is "a few times"?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Posts: 11,401Member, Sous Chef, PRO, Senior Sous-Chef

    The "never be touched again" part is taken care of because a rule only fires when its condition changes value (e.g. from false to true). So when self.Touched changes from false to true, the rule fires. But if you touch the actor again, self.Touched is already true and the rule doesn't fire.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • cercan57cercan57 Posts: 6Member, PRO

    Thank you, very very good

Sign In or Register to comment.