waynemwashuma / chaos-engine

2d game engine
https://waynemwashuma.github.io/chaos-engine/
MIT License
3 stars 0 forks source link

`Manager()` skips frames on pause then play. #26

Closed waynemwashuma closed 4 months ago

waynemwashuma commented 7 months ago

Whenever Manager.pause() is called then Manager,play() called after some time, the game skips some frames in order to 'catch up'. Suspecting the delta time accumulation to be the reason for that.

waynemwashuma commented 7 months ago

Solution: Create two types of clocks: 1.One for keeping tabs on the real time. 2.One to keep tabs on the game time.

The second clock will be used to generate delta time for each frame instead of the first.