We as devs typically all have the same system driving our games, a nominal game loop that resembles this one:
let lastTime = 0;
let id;
function loop(time) {
id = requestAnimationFrame(loop);
updateGame(time - lastTime);
lastTime = time;
}
function stop() {
cancelAnimationFrame(id);
}
Maybe yours differs from this and uses setTimeout or setInterval or something more sophisticated involving web workers, the idea in this post still applies to you.
And we all know the "disable browser occlusion" trick that we inform our players of so that our games can still make progress when they're in the background ([which apparently Chrome ha
