This topic has been brought up before, but I couldn’t find a solution to this problem.
I want my tweens to continue even when the tab is not focused.
I’ve read that this behavior comes from the browser and not Phaser, but then I ask myself why Phaser doesn’t do something about it itself as soon as the focus is back.
Could someone give me a tip on how to work around this behavior? I’m doing an MMO and delayed tweens would be very annoying.
I use tweens to move the avatars. When you click on a position, the avatar should walk there.
Do you have an example of how to seek the tween when focus is regained? The toPosition field in seek is a value from 0 to 1, how should I calculate this?
skipMissedFrames is already enabled by default, so I think it must be something else. The longer the focus is gone, the longer the animation plays at a high frame rate when focus returns.
I disabled skipMissedFrames, but then the animation keeps playing at a higher frame rate when focus returns.
The missed frames should not be played at once, but a jump should be made to the actual frame.
Edit: I played around with the Phaser source code and removing safetyNet (especially the safetyNet < 60 part) indeed fixed the problem. Should I report this on GitHub or does safetyNet have a reason?