Multiple Touches

bluebyu25bluebyu25 Member Posts: 500
edited November -1 in Working with GS (Mac)
Hey All,

I have a behavior set up that when touch is pressed an actor accelerates x amount.

What I can't figure out is how to say after the actor has been pressed once, the second time it is pressed it should destroy the actor.

Thanks in advance.

Cheers

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    you need to track the number of touches on the actor by creating a local attribute, and on every touch increment it by 1.

    so if actor receives touch, set attribute self. touches to self.touches + 1

    if self.touches = 1
    move faster

    if self.touches =2
    destroy actor
  • bluebyu25bluebyu25 Member Posts: 500
    Amazing, thanks jonmulcahy. I am starting to get a hang of how powerful these attributes can be
  • johnson_tarajohnson_tara Member Posts: 6
    So happy to have found this! been going around in circles for a while.
Sign In or Register to comment.