raylib game loop and states
Organizes the game’s startup, update, draw and shutdown sequence. It makes menu, play and pause states explicit and prevents long pauses from causing unlimited simulation work on return.
raylib-loop-state
See how it helpsWhen is it useful?
Use when raylib state changes duplicate drawing or timing becomes unstable after a stall.
What does it help you do?
- Assigns one owner to window and graphics-context lifetime.
- Separates updates from drawing with consistent elapsed-time units.
- Bounds simulation catch-up instead of replaying unlimited work after pauses.
Try asking this
For our runner, add title, play, pause and game-over states. Leave the window inactive for thirty seconds and resume. The character must not jump far ahead, score must change during updates only and restarting must reset the round without recreating the window unnecessarily.
Detailed documentation
Read the skill’s original instructions, examples and checks in their authored language.
Show less
raylib — loop state
Use when building raylib game loops, application states, restart or pause behavior.
Version and project gate
Inspect The local raylib.h version, linked library, C/C++ build system, platform backend, asset paths, compile flags and ownership conventions. Match the cheatsheet to the linked version rather than assuming the current website API. Never turn a task into an engine upgrade without the user’s intent. Read the version-matching official reference when an API decision depends on it.
Work
Establish window/context initialization and shutdown ownership. Separate state update from drawing and define explicit enter/exit hooks for menu, play and pause. Keep frame delta units consistent; use a fixed simulation accumulator only where gameplay needs it. Bound catch-up after stalls.
Deliver
A small state transition design and a complete executable path from startup to clean exit. Keep the change in the existing project structure; separate actual observations from the proposed acceptance scenario below.
Failure to prevent
Do not start a second drawing frame inside a helper or run unbounded simulation catch-up after a debugger pause.
Acceptance scenario
Start, pause, restart and exit during each game state; confirm consistent movement after an artificial frame stall. Follow the project’s execution and verification permissions. If execution or a target device is unavailable, provide the reproduction steps and name the remaining uncertainty; do not mark it passed.
Scope and sources
This skill belongs to Flint. Agent selection is restricted by Orqestria’s assigned-agent policy, including forced skill selection; instruction text alone is not an access control. These are original task workflows researched from official documentation, not a copied or endorsed vendor skill.
Included files 1
SKILL.md
