A WebGPU retro game engine for TypeScript, inspired by RetroBlit. Build pixel-perfect 2D games with a clean, fantasy-console-style API.

fix(utils): prevent timer lock on hard tick-counter rewind master

When lastFiredTick is well ahead of currentTick (e.g. after a global reset to 0), elapsedTicks() clamped to 0 but the old baseline was never cleared. The timer would lock until currentTick reached lastFiredTick + intervalTicks. Add an explicit guard at the top of tick(): if currentTick < lastFiredTick, reset the baseline to currentTick and return false. The timer then fires again after exactly intervalTicks from the rewound position. Splits the shallow-rewind test and adds a dedicated hard-rewind regression test (lastFiredTick=1000, rewind to 0). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Vaclav Vancura <commit@vancura.dev>


+21 -1
2 changed files