Game updates and pausing
See what the SDK updates each frame and how it pauses the game.
The SDK updates the layout, scene services, physics, particles, and tweens in a fixed order. Game code takes part through component and service update methods.
Components use onUpdate(dt), and scene services use onSceneTick(ctx). A service with tickPhase: 'physics' updates during the physics phase.
Pause reasons
An inactive tab, a manual action, the platform, or an ad can pause the game. The game stays paused while any reason is active. When an ad ends, the game stays paused if the tab is still inactive.
TweenManager.delayMs stops counting while the game is paused.
Read the activity state to check whether the game is paused.
const snapshot = this.node.engine.activity.getSnapshot();
const paused = snapshot.effectivePaused;
activity.subscribe(handler) reports changes to the pause state and returns a function that unsubscribes.