kittykatattack / hexi

Make games the fun way!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to stop Pulse Tween effect?

Digital-Odyssey opened this issue · comments

Hi,

First off just i want to say i purchased both "Advanced Game with HTML5 & Javascript" and "The Advanced Game Developers Toolkit" as a follow up to the first book and they are both fantastic books.

I just have a quick question - is it possible to get the Pulse tween effect to stop after 3 pulses? If so how i would i go about doing it?

Thanks, appreciate any help you can provide.

@PulsarMedia Thank you for posting this!
There's isn't a feature to set the number of iterations, but I suppose you could count the number of frames that have elapsed, and stop the animation when that number reaches your target?

What would be your recommended approach to counting the frames? I am guessing i would need to run an interval loop to count them?

I tried using the onComplete method with a counter variable but that didn't seem to work.

Thanks for getting back to me.

@PulsarMedia Probably just a variable to track the number of frames elapsed since the beginning of the tween, and stop the tween when your target number is reached?