Jump to content

Incomplete animations and tweens


mariogarranz
 Share

Recommended Posts

I've found a little problem with tweens and animations in my game. Sometimes they just halt before they are finished. For example, I'm moving some elements inside and outisde of the screen using tweens. Well, if I change the navigator's tab before the tween is complete, when I come back to the same tab the tween is already stopped, even though tweened values (x position in this case) haven't yet reached their target value.

 

Something similar happens with animations. I noticed when trying my game on an Android device that during the first time the game starts, when all the elements are created (and, therefore, CPU usage is higher) animations will stop before they reached their last frame.

Is this a bug, or am I doing something wrong?

I'm using Phaser 1.1.3.

Link to comment
Share on other sites

OK, so after digging into this I found that both problems are related to high CPU charge and therefore long time update loops.

 

When there is one of these long time loops, the tween and animation values are updated according to the time elapsed since last update loop, meaning they can make a big jump in values.

 

- The tween problem was my fault, I fixed it.

- The animation problem seems like a Phaser bug to me. If time passed from one update loop to another one is big enough, animation will end in the second loop, but wont update its frame to the last one, leaving the animation unfinished.

Could someone please tell me if I'm right about the animations? 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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