Jump to content

Action after all Tweens


semanser
 Share

Recommended Posts

Could you set a timer to fire after a length of time longer than the longest tween? Eg if all of your Tweens run over 100ms,set a timer to complete after 110ms and run the recalculation/deletions. I think this is the method that gemswap on the phaser examples page uses.

Link to comment
Share on other sites

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...