systems/pause_intent_builtin¶
Goal¶
See how IntentPauseSystem detects a pause key press and drives a
pause overlay without any custom input handling code.
Why this tutorial exists¶
Pausing a game is a universal requirement. The built-in
IntentPauseSystem handles:
detecting the pause key (default:
P)toggling a
pausedflag on the scene contextallowing a pause overlay scene to render on top
This example wires two scenes — a gameplay scene with a bouncing box and a semi-transparent pause overlay — and lets the built-in system manage the transition.
Source map¶
Settings profile:
examples/settings/systems/pause_intent_builtin.ymlExample builder:
examples/catalog/systems/pause_intent_builtin/main.pyScene:
examples/catalog/systems/pause_intent_builtin/scenes/scene.pyShared runner:
examples/_shared/runner.py
What to verify¶
You should see:
a bouncing cyan box with a frame counter
pressing
Ppauses the simulation — the box freezesa dark overlay with “PAUSED” text appears
pressing
Pagain resumes the simulationthe frame counter only increments while unpaused
Controls¶
Key |
Action |
|---|---|
|
Toggle pause |
|
Quit |
Run¶
mini-arcade run --example systems/pause_intent_builtin
mini-arcade run --example systems/pause_intent_builtin --pass-through --backend pygame
mini-arcade run --example systems/pause_intent_builtin --pass-through --backend native
Common mistakes¶
Forgetting to register the overlay scene in the same discover package.
Manually checking for the pause key when the built-in system already does it.
Not accounting for the paused state in custom systems — they still receive
step()calls unless they check the context flag.