Records commands applied each tick so the simulation can be replayed later.
Usage:
const recorder = new ReplayRecorder(world); // snapshot before first step
recorder.record(world.tick, cmds); // call once per tick
stepWorld(world, cmds, ctx);
const replay = recorder.toReplay();
Records commands applied each tick so the simulation can be replayed later.
Usage: const recorder = new ReplayRecorder(world); // snapshot before first step recorder.record(world.tick, cmds); // call once per tick stepWorld(world, cmds, ctx); const replay = recorder.toReplay();