Best way to tap multiple times to destroy?

jigglybeanjigglybean Member Posts: 1,584
edited January 2014 in Working with GS (Mac)
Hey all
I am looking for the best way to make the following happen. I have had a little play around but still struggling to make it work properly

Essentially I want the user to tap an object 5 times, then destroy the actor.

Any ideas? thanks in advance

Comments

  • HopscotchHopscotch Member, PRO Posts: 2,782
    @jigglybean, what problem are you encountering?

    Use the "Rule:Actor receives event Touch is released" to increment an Attribute and prevent it from adding multiple times while the object is beeing pressed.



  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    I'd do something like this:

    create a local attribute on the actor called count

    when touch is pressed count = count +1 when count >= 5 destroy actor
    the reason I put count >= 5 is if they hit the actor too quick it could jump from 4 to 6 and miss the value of 5.
  • jigglybeanjigglybean Member Posts: 1,584
    I'd do something like this:

    create a local attribute on the actor called count

    when touch is pressed count = count +1 when count >= 5 destroy actor
    the reason I put count >= 5 is if they hit the actor too quick it could jump from 4 to 6 and miss the value of 5.
    Ah yes! I will give this a try...cheers
Sign In or Register to comment.