Double Tap an Actor to Destroy with no timers
stahboy
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
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.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
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!
Lump Apps and My Assets
Thank you guys! I'll use the timers and see if I can use the custom timers
Here is an example of how to make a double-click detection without using a timer behavior.
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
@RThurman, @LyboTech
Thank you! I will look into those suggestions! I appreciate the help
stahboy