Double Tap an Actor to Destroy with no timers

stahboystahboy Member, PRO Posts: 150

What is the best way to have an actor and when you double tap it, it will get destroyed? I have looked at the forums and the only methods I found have timers. I know that timers are performance heavy so avoiding them will be nice.

Cheers

stahboy

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    I use a good amount of timer in all of my project and they work great on the devices; with the changes to the code base, I don't think you'll have any problems using a timer or two.

  • LumpAppsLumpApps Member Posts: 2,881
    edited July 2014

    You can make custom timers that are not performance heavy. Have a look here:
    http://forums.gamesalad.com/discussion/44707/timers-are-for-chumps-gs-optimization-tips/p1

    Note that you do not need to make the attribute mod1 anymore for the EVERY X SECONDS TIMER REPLACEMENT. You can use the newish Numeric expression in the rules!

  • stahboystahboy Member, PRO Posts: 150

    Thank you guys! I'll use the timers and see if I can use the custom timers

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881

    Here is an example of how to make a double-click detection without using a timer behavior.

  • LyboTechLyboTech Member Posts: 135

    Create an integer attribute in your actor for the health and set it to 2, then create a rule
    If touch is inside
    Change attribute self.health to self.health-1

    and another rule
    If self.health < 1 destroy actor

  • stahboystahboy Member, PRO Posts: 150

    @RThurman‌, @LyboTech‌

    Thank you! I will look into those suggestions! I appreciate the help

    stahboy

Sign In or Register to comment.