// A heartbeat for the game loop. Browsers stop animation frames in a background tab and slow // down its timers, but a worker's timer keeps going, so the game can keep running while hidden. setInterval(() => postMessage(0), 100);