Phaser 2D Game
Use Phaser for new 2D games that benefit from sprites, tilemaps, cameras, timing, scene orchestration, or arcade-style interaction. Do not migrate a working non-Phaser game merely because this skill is available.
Architecture
- Keep game rules, progression, inventory, combat, objectives, and saveable state outside Phaser scenes.
- Let scenes adapt simulation state into sprites, animations, cameras, particles, audio, and input events.
- Use a small scene set: boot or preload, menu when needed, gameplay, and optional overlay or debug scenes.
- Treat sprites, tweens, emitters, and camera rigs as disposable view state.
- Use stable asset keys and centralize loading.
- Put dense HUD, menus, settings, and accessible controls in DOM overlays.
Change Modes
- For a feature, trace the state owner, action mapping, scene adapter, HUD effects, and persistence impact before editing.
- For a bug, reproduce the relevant state transition and inspect timing, lifecycle, input, collision, and scene restart behavior before changing code.
- For a refactor, retain observable timing and controls unless the user requested behavior changes.
Browser Requirements
- Resize the renderer and camera intentionally; do not stretch gameplay coordinates accidentally.
- Support keyboard and pointer input, and add touch controls when the target experience needs them.
- Pause or gate gameplay input under menus and dialogs.
- Keep effects readable: screen shake, hit stop, flashes, and particles should communicate state rather than hide it.
Verification
Build the project, boot the first actionable scene, exercise the affected player actions, and check scene transitions or restart paths. Use ../game-playtest/SKILL.md for broader browser or visual verification.
1---2name: phaser-2d-game3description: Build and modify Phaser 2D browser games with TypeScript, Vite, gameplay systems, scenes, cameras, animation, input, and DOM overlays.4metadata:5 source: https://skillmd.com/skills/whitetowerai/phaser-2d-game6---78# Phaser 2D Game910Use Phaser for new 2D games that benefit from sprites, tilemaps, cameras, timing, scene orchestration, or arcade-style interaction. Do not migrate a working non-Phaser game merely because this skill is available.1112## Architecture1314- Keep game rules, progression, inventory, combat, objectives, and saveable state outside Phaser scenes.15- Let scenes adapt simulation state into sprites, animations, cameras, particles, audio, and input events.16- Use a small scene set: boot or preload, menu when needed, gameplay, and optional overlay or debug scenes.17- Treat sprites, tweens, emitters, and camera rigs as disposable view state.18- Use stable asset keys and centralize loading.19- Put dense HUD, menus, settings, and accessible controls in DOM overlays.2021## Change Modes2223- For a feature, trace the state owner, action mapping, scene adapter, HUD effects, and persistence impact before editing.24- For a bug, reproduce the relevant state transition and inspect timing, lifecycle, input, collision, and scene restart behavior before changing code.25- For a refactor, retain observable timing and controls unless the user requested behavior changes.2627## Browser Requirements2829- Resize the renderer and camera intentionally; do not stretch gameplay coordinates accidentally.30- Support keyboard and pointer input, and add touch controls when the target experience needs them.31- Pause or gate gameplay input under menus and dialogs.32- Keep effects readable: screen shake, hit stop, flashes, and particles should communicate state rather than hide it.3334## Verification3536Build the project, boot the first actionable scene, exercise the affected player actions, and check scene transitions or restart paths. Use `../game-playtest/SKILL.md` for broader browser or visual verification.