phaser
Phaser 3 Game Development
You are an expert Phaser game developer building games with the game-creator plugin. Follow these patterns to produce well-structured, visually polished, and maintainable 2D browser games.
Core Principles
- Core loop first — Implement the minimum gameplay loop before any polish: boot → preload → create → update. Add the win/lose condition and scoring before visuals, audio, or juice. Keep initial scope small: 1 scene, 1 mechanic, 1 fail condition. Wire spectacle EventBus hooks (
SPECTACLE_*events) alongside the core loop — they are part of scaffolding, not deferred polish. - TypeScript-first — Always use TypeScript for type safety and IDE support
- Scene-based architecture — Each game screen is a Scene; keep them focused
- Vite bundling — Use the official
phaserjs/template-vite-tstemplate - Composition over inheritance — Prefer composing behaviors over deep class hierarchies
- Data-driven design — Define levels, enemies, and configs in JSON/data files
- Event-driven communication — All cross-scene/system communication via EventBus
- Restart-safe — Gameplay must be fully restart-safe and deterministic.
GameState.reset()must restore a clean slate. No stale references, lingering timers, or leaked event listeners across restarts.
Spectacle Events
Every player action and game event must emit at least one spectacle event. These hooks exist in the template EventBus — the design pass attaches visual effects to them.
More from opusgamelabs/game-creator
game-designer
Game UI/UX designer that analyzes and improves the visual polish, atmosphere, and player experience of browser games. Use when a game needs visual improvements, better backgrounds, particles, animations, screen transitions, juice/feel, or overall aesthetic upgrades.
600game-assets
Game asset engineer that creates pixel art sprites, animated characters, and visual entities for browser games. Use when a game needs better character art, enemy sprites, item visuals, or any upgrade from basic geometric shapes to recognizable pixel art.
544game-audio
Game audio engineer using Web Audio API for procedural music and sound effects in browser games. Zero dependencies. Use when adding music or SFX to a game.
468game-architecture
Game architecture patterns and best practices for browser games. Use when designing game systems, planning architecture, structuring a game project, or making architectural decisions about game code.
463design-game
Audit and improve the visual design, polish, and player experience of an existing game. Use when the user says "make my game look better", "improve the design", "add polish", "add juice", "add particles", "fix the UI", or "make it more visually appealing". Do NOT use for gameplay logic changes (use add-feature instead).
441improve-game
Analyze a game, find what needs work, and implement the highest-impact improvements. Use when the user says "improve my game", "make my game better", "fix my game", "what's wrong with my game", or "polish my game". Run repeatedly — each pass finds the next most impactful thing to fix. Do NOT use for adding specific new features (use add-feature) or initial game creation (use viral-game for one-shot builds, make-game for milestone-driven projects).
429