How to prevent the game from pausing?

Is there anyway to prevent the game from pausing when i switch tab on browser?

The game loop uses the browser’s requestAnimationFrame function, which does not run if the tab isn’t focused. I think you can force it to use setTimeout instead, which will run even if the tab isn’t focused, but it’ll likely be throttled. I’m not aware of any ways to make the game run completely normally in an unfocused tab.

1 Like