create touch count rule

Hi, I wanted to have an actor destroy on say 3 touch's - how can this be done? At the moment I can only get it to work with a single touch.

Thanks

Comments

  • WingmanappsWingmanapps Member Posts: 458
    edited July 2013
    Create a new integer called "touchcount"

    Go to your actor and create a new rule
    When touch is pressed
    Change attribute game.touchcount to game.touchcount +1
    Create a new rule
    If game.touchcount = 3
    Destroy actor
  • DantippleDantipple Member Posts: 12
    Create a new integer called "touchcount"

    Go to your actor and create a new rule
    When touch is pressed
    Change attribute game.touchcount to game.touchcount +1
    Create a new rule
    If game.touchcount = 3
    Destroy actor
    Thanks, can you display the actor as different images along the 3 touches? I.e the 1st touch causes damage, the second creates more and then the final causes a boom
  • WingmanappsWingmanapps Member Posts: 458
    Sure just make the different images and say when touchcount = 1
    Change image to (whatever)
    If touchcount = 2
    Change image to (whatever)
    If touchcount = 3
    Animate explosion
Sign In or Register to comment.