I want to run two animations in sequence. First animation is initially looped, then slow downed by tween, and when tween is complete (speed of animation is reduced) I want to stop that animation and run second. Problem is, because I want to set up end frame other than specified in animation creation; i.e. I want to first animation run until end frame is reached. Otherwise I could simply set up loop parameter to false and then run second animation.
What is most efficient way to achieve this? Some API like Phaser.Animation.stop(index_of_end_frame) will be perfect for my purposes. Stopping animation when specified frame is reached.
My solution is get number of pending frames ( amount of frames that must elapse to reach end frame), multiply it by delay of animation, and set up timeout that stop current animation and run second.