phaser-gamedev
БесплатноБез исполняемых скриптовНе проверенBuild 2D browser games with Phaser 3 (JS/TS): scenes (Boot/Menu/Game/UI), sprites/animations, input, Arcade/Matter physics, tilemaps (Tiled), asset loading…
от chongdashu★ 37 звёзд на GitHubОб этом скилле
Phaser Game Development
Build fast, polished 2D browser games using Phaser 3’s scene-based architecture and physics systems.
Philosophy: Games as Living Systems
Games are not static UIs—they are dynamic systems where entities interact, state evolves, and player input drives everything.
Before building, ask:
- What scenes does this game need? (Boot, Menu, Game, Pause, GameOver, UI overlay)
- What are the core entities and how do they interact?
- What state must persist across scenes (and what must not)?
- What physics model fits? (Arcade for speed, Matter for realism)
- What input methods will players use? (keyboard/gamepad/touch)
Core principles:
- Scene-first architecture: Organize code around scene lifecycle and transitions.
- Composition over inheritance: Build entities from sprite/body/controllers, not deep class trees.
- Physics-aware design: Choose collision model early; don’t retrofit physics late.
- Asset pipeline discipline: Preload everything; reference by keys; keep loading deterministic.
- Frame-rate independence: Use
deltafor motion and timers; avoid frame counting.
Workflow: Build the Spine First
- Define the minimal playable loop (movement + win/lose + restart) before content/polish.
- Decide scene graph and transitions (including UI overlay scene if needed).
- Choose physics system early:
- Arcade for most games (platformers/top-down/shooters).
- Matter for realistic collision/constraints/ragdolls.
- None for non-physics scenes (menus, VN, card games).
- Implement a reliable asset-loading path (Boot scene), then scale out content.
- Add debug toggles/profiling early so performance doesn’t become a late surprise.
Use References (Progressive Disclosure)
references/core-patterns.md: config, scene lifecycle, objects, input, animations, asset loading, project structure.references/arcade-physics.md: Arcade physics deep dive (including pooling patterns).references/tilemaps.md: Tiled tilemap workflows, collision setup, object layers.references/performance.md: optimization strategies (pooling, batching, culling, camera, texture atlases).references/spritesheets-nineslice.md: spritesheet loading (spacing/margin), nine-slice UI panels, asset inspection protocol.
Anti-Patterns to Avoid
❌ Global state soup: Storing game state on window or module globals
Why bad: scene transitions become fragile; debugging becomes chaotic
Better: scene data, registries, or a dedicated state manager
❌ Loading in create(): Loading assets in create() instead of preload()
Why bad: assets may not be ready when referenced
Better: load in preload(); use a Boot scene for all assets
❌ Frame-dependent logic: Using frame count instead of delta
Why bad: game speed varies with frame rate
Better: scale by (delta / 1000) for consistent movement/timers
❌ Physics overkill: Using Matter for simple platformer collisions
Why bad: unnecessary complexity + perf cost
Better: Arcade covers most 2D collision needs
❌ Monolithic scenes: One giant scene with all game logic
Why bad: hard to extend; UI/menus/pause become hacks
Better: separate gameplay vs UI overlay vs menus
❌ Magic numbers everywhere: Hardcoded tuning values scattered in code
Why bad: balancing becomes painful; changes cause regressions
Better: config objects/constants and centralized tuning
❌ No pooling for spammy objects: Creating/destroying bullets/particles constantly
Why bad: GC spikes → stutters
Better: object pooling with groups + setActive(false) / setVisible(false)
❌ Assuming spritesheet frame dimensions: Using guessed frame sizes without verifying source asset Why bad: wrong dimensions cause silent frame corruption; off-by-pixels compounds into broken visuals Better: open asset file, measure frames, calculate with spacing/margin, verify math adds up
❌ Ignoring spritesheet spacing: Not specifying spacing for gapped spritesheets
Why bad: frames shift progressively; later frames read wrong pixel regions
Better: check source asset for gaps between frames; use spacing: N in loader config
❌ Hardcoding nine-slice colors: Using single background color for all UI panel variants Why bad: transparent frame edges reveal wrong color for different asset color schemes Better: per-asset background color config; sample from center frame (frame 4)
❌ Nine-slice with padded frames: Treating the full frame as the slice region when the art is centered/padded inside each tile Why bad: edge tiles contribute interior fill, showing up as opaque “side bars” inside the panel Better: trim tiles to their effective content bounds (alpha bbox) and composite/cache a texture; add ~1px overlap + disable smoothing to avoid seams
❌ Scaling discontinuous UI art: Scaling a cropped banner/ribbon row that contains internal transparent gaps Why bad: the transparent gutters scale too, maki
Установить phaser-gamedev в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл phaser-gamedev?
Build 2D browser games with Phaser 3 (JS/TS): scenes (Boot/Menu/Game/UI), sprites/animations, input, Arcade/Matter physics, tilemaps (Tiled), asset loading, and performance patterns. Use for prompts like 'Phaser scene', 'Arcade physics', 'tilemap', 'Phaser 3 game architecture'.
Как установить скилл phaser-gamedev?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл phaser-gamedev запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic