add-3d-assets
Replace primitive 3D shapes with real GLB models — animated characters, world props, buildings, and scenery for Three.js games.…
Build 2D browser games with Phaser 3 using scene-based architecture and centralized state. Use when creating a new 2D game, adding 2D game features, working with Phaser, or building sprite-based web games.
$ npx -y skills add playableintelligence/game-creator --skill phaser --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/phaserContext preview
The summary Claude sees to decide when to auto-load this skill.
Build 2D browser games with Phaser 3 using scene-based architecture and centralized state. Use when creating a new 2D game, adding 2D game features, working with Phaser, or building sprite-based web games.
name: phaser description: > Build 2D browser games with Phaser 3 using scene-based architecture and centralized state. Use when creating a new 2D game, adding 2D game features, working with Phaser, or building sprite-based web games. argument-hint: [topic or question] license: MIT metadata: author: OpusGameLabs version: 1.3.0 tags: [game, 2d, phaser, scenes, sprites, arcade-physics]
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.
1. **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. 2. **TypeScript-first** — Always use TypeScript for type safety and IDE support 3. **Scene-based architecture** — Each game screen is a Scene; keep them focused 4. **Vite bundling** — Use the official `phaserjs/template-vite-ts` template 5. **Composition over inheritance** — Prefer composing behaviors over deep class hierarchies 6. **Data-driven design** — Define levels, enemies, and configs in JSON/data files 7. **Event-driven communication** — All cross-scene/system communication via EventBus 8. **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.
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.
| Event | Constant | When to Emit | |-------|----------|--------------| | `spectacle:entrance` | `SPECTACLE_ENTRANCE` | In `create()` when the player/entities first appear on screen | | `spectacle:action` | `SPECTACLE_ACTION` | On every player input (tap, jump, shoot, swipe) | | `spectacle:hit` | `SPECTACLE_HIT` | When player hits/destroys an enemy, collects an item, or scores | | `spectacle:combo` | `SPECTACLE_COMBO` | When consecutive hits/scores happen without a miss. Pass `{ combo: n }` | | `spectacle:streak` | `SPECTACLE_STREAK` | When combo reaches milestones (5, 10, 25, 50). Pass `{ streak: n }` | | `spectacle:near_miss` | `SPECTACLE_NEAR_MISS` | When player narrowly avoids danger (within ~20% of collision radius) |
**Rule**: If a gameplay moment has no spectacle event, add one. The design pass cannot polish what it cannot hook into.
All games MUST follow the [game-creator conventions](conventions.md):
See [conventions.md](conventions.md) for full details and code examples.
Use the official Vite + TypeScript template as your starting point:
npx degit phaserjs/template-vite-ts my-game cd my-game && npm install
src/ ├── core/ │ ├── EventBus.ts # Singleton event bus + event constants │ ├── GameState.ts # Centralized state with reset() │ └── Constants.ts # ALL config values ├── scenes/ │ ├── Boot.ts # Minimal setup, start Game scene │ ├── Preloader.ts # Load all assets, show progress bar │ ├── Game.ts # Main gameplay (starts immediately, no title screen) │ └── GameOver.ts # End screen with restart ├── objects/ # Game entities (Player, Enemy, etc.) ├── systems/ # Managers and subsystems ├── ui/ # UI components (buttons, bars, dialogs) ├── audio/ # Audio manager, music, SFX ├── config.ts # Phaser.Types.Core.GameConfig └── main.ts # Entry point
See [project-setup.md](project-setup.md) for full config and tooling details.
When games run inside the Play.fun dashboard on mobile Safari, the SDK sets CSS custom properties on the game iframe's `document.documentElement`:
Both default to `0px` when not running inside the dashboard (desktop, standalone).
The template's `Constants.js` reads these at boot and exposes `SAFE_ZONE.TOP` and `SAFE_ZONE.BOTTOM` in canvas pixels (CSS value × DPR). A static fallback (`GAME.HEIGHT * 0.08`) ensures the top safe zone works even without the SDK.
**Rules:**
Go from game idea to deployed, monetized browser game in minutes — not hours. Tell your AI coding agent "make a space invaders game" and get a fully playable 2D or 3D browser game with pixel art, procedural audio, and automated QA. Deploy instantly to the web.
Replace primitive 3D shapes with real GLB models — animated characters, world props, buildings, and scenery for Three.js games.…
Replace geometric shapes with pixel art sprites — recognizable characters, enemies, and items with optional animation. Use when…
Add music and sound effects to a game using the Web Audio API — background music, gameplay themes, and SFX. Zero dependencies.…
Add a new gameplay feature to an existing browser game following its architecture patterns. Use when the user says "add a…
Add real-time or turn-based multiplayer to an existing browser game using PartyKit (Cloudflare Durable Objects). Scaffolds a…
Audit and improve the visual design, polish, and player experience of an existing game. Use when the user says "make my game look…