How can I make an actor die or disappear after five taps?

Dell7730Dell7730 Member, PRO Posts: 388

I'm trying to make it look like i'm fighting an actor and he'll die after five clicks or touch press on it, any suggestions? I have a rough idea on how to do it but just assuming someone has a much better and faster way of implementing something like this.

Best Answers

Answers

  • Dell7730Dell7730 Member, PRO Posts: 388

    @supafly129 said:
    Create an integer attribute within the actor called "Tap" or whatever you want to name it

    Create a rule "When touch pressed" --> Change self.Attribute Tap to self.Attribute Tap +1

    Create a rule "When self. Attribute Tap = 5" --> Destroy Actor

    Screenshot
    http://www.tiikoni.com/tis/view/?id=558337a

    AWESOMEEEEEE! Thanks Very Much!

  • Dell7730Dell7730 Member, PRO Posts: 388

    @supafly129 said:

    Follow up question, how can I reset it to start counting again once it's done getting that 5 taps?

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Dues said:

    When touch is pressed

    Change Attribute: game.tap to (game.tap + 1)%6

    that makes it go to 5 and when you tap it again it resets to 0 and starts over.

    Just remember that when you destroy an actor, it actually gets destoyed. I would recommend to move its position off screen instead of destroying it.

    that's what exactly my question is for cause I wasn't destroying the actor but moving it out of range rather, thanks again, as always you're awesome

  • Dell7730Dell7730 Member, PRO Posts: 388

    @supafly129 said:
    Change self. attribute Tap to 0"

    very very very much appreciated

  • Dell7730Dell7730 Member, PRO Posts: 388

    @supafly129 @Dues Last question in regards to this matter, lol...... How can I make it reset to zero if I didn't make the set amount of taps within a time frame. Ex: I need to tap 5 times within 10 seconds, if I don't make it, it'll reset to zero and start over again.

  • Dell7730Dell7730 Member, PRO Posts: 388

    I figured it out, I put a timer that in after 10 seconds: if game.attribute is < 5, then reset to 0

Sign In or Register to comment.