Jump to content

Action after all Tweens


semanser
 Share

Recommended Posts

Hi all! I want to do game like Candy Crush (example http://copycut.github.io/gems-swapper/) on Phaser. I use Tweens in Phaser to move all tiles. But I have some problem... I need to recalculate and delete some tiles, only after all tween on the scene are complited. How realize this?

 

If you know how many tweens are going to be called you could create two variables, one for the total tweens and one for completed tweens. And then after each tween completes increment that number and check to see if the two variables are the same, if they are then all of your tweens have been completed so you could then run the code or call the function now they have all finished.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...