Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to stop Pulse Tween effect? #51

Open
Digital-Odyssey opened this issue Nov 20, 2017 · 3 comments
Open

How to stop Pulse Tween effect? #51

Digital-Odyssey opened this issue Nov 20, 2017 · 3 comments

Comments

@Digital-Odyssey
Copy link

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.

@kittykatattack
Copy link
Owner

@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?

@Digital-Odyssey
Copy link
Author

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.

@kittykatattack
Copy link
Owner

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants