QLNEO Posted November 17, 2017 Share Posted November 17, 2017 I'm trying to sync a looping tween to a beat, by calculating the tween duration (therefore, the interval) from the BPM. But it's always off-sync! I investigated a bit by subtracting small values to see if I reach some kind of "fake sync", but it turns out the tween seems to be incremental (maybe with the frame updates?), and that won't do. Should I try using the Timer instead or there's a better way? Link to comment Share on other sites More sharing options...
samme Posted November 17, 2017 Share Posted November 17, 2017 It's possible that time deltas smaller than the frame interval (16ms) are lost when the tween loops back to the beginning. But i'm not sure. You can just update the animation (or whatever) yourself using the Phaser.Sound#currentTime value. Link to comment Share on other sites More sharing options...
QLNEO Posted November 22, 2017 Author Share Posted November 22, 2017 It's likely. From my testing (as I said, the duration, or at least the looping, seems to be incremental), it appears that the tween loops starting with a frame update. I ended up using the Timer instead, that did the trick. Link to comment Share on other sites More sharing options...
Recommended Posts