ondras / rot.js

ROguelike Toolkit in JavaScript. Cool dungeon-related stuff, interactive manual, documentation, tests!
https://ondras.github.io/rot.js/hp/
BSD 3-Clause "New" or "Revised" License
2.32k stars 254 forks source link

How to reset the speed-scheduler? #186

Closed Gerhard-Wonner closed 3 years ago

Gerhard-Wonner commented 3 years ago

I am currently writing a replay-feature for my game. Therefore I save the seed and all the player inputs. This works fine in the first level and I get a nice replay to watch.

However there is a problem in level 2. I get the same level layout and all starting positions also match. But by whatever reason it seems that some monsters do their turn a little later in the replay compared to the original game. It seems like the speed scheduler still remembers some events from the previous level.

Is there a way to reset the speed-scheduler to its initial state (as if it was newly created)?

Gerhard-Wonner commented 3 years ago

Fortunately I could solve my problem! :-) My guess that it was the scheduler was wrong.