Does anyone have some advice for syncing multiple actions going on with each other so that lag (caused by other phone processes activating while playing the game) will affect all equally.
For example, I have a character that moves right or left using applyForce and up or down based on jump actions and gravity. I also have objects throughout each level that move or rotate using transition.to. There is also a count up timer (using delta time) that runs to record the time it takes to finish the level. And I have a recording function that records the characters’ X, and Y coordinates at a set interval. This recording can be played back using transition.to so that the player can race against a ghost player of their best time. This playback operates based on the count up timer and the recorded time stamp intervals.
All these things seem to be affected differently by lag, the frame rate, and maybe even the processor speed of the device the user is on.
Does anyone have any advice on how to sync all these things up so they would be timed more perfectly relative to each other and to lag?
Thanks in advance for any advice.