Automated summary
This skill guides building 2D browser games with Phaser 3, covering scene-based architecture, sprites, Arcade/Matter physics, tilemaps, and the game loop.
Strengths
- Enforces a spritesheet measurement protocol before any loader code, preventing silent frame corruption that compounds into broken visuals
- Pushes early architecture decisions: physics system choice, scene layout, and scene transition patterns
- Ships concrete, adaptable snippets for game config, scene lifecycle, and frame-rate independent movement
- Points to focused reference files (tilemaps, Arcade physics, performance) depending on the task at hand
Limitations
- The provided document cuts off mid-table in the anti-patterns section, so that part and anything after it are missing
- Depends on external reference files (references/*.md) not included here, which are mandatory for spritesheets and tilemaps
- Covers only Phaser 3 in TypeScript/JavaScript for the web; no guidance on builds, deployment, or testing
Use it when starting or extending a Phaser 3 2D game: setting up scenes, loading spritesheets, tuning physics, or wiring tilemaps.
Skip it for projects on other engines (Unity, Godot, plain PixiJS) or for 3D rendering, which are outside this skill's scope.
Security analysis
SafeThe skill is instructional documentation for Phaser 3 game development. It contains no executable commands, no network or filesystem operations, no secret handling, and no destructive instructions. References to external markdown files are ordinary documentation pointers and pose no meaningful execution risk.
No concerns found
How this analysis is madeExamples
Create a Phaser 3 game with a Boot scene, a Menu scene, and a Game scene where the player jumps on platforms with Arcade physics.Load this character spritesheet into my Phaser scene and set up a run animation — the frames look misaligned, help me get the frameWidth and spacing right.Add a Tiled tilemap to my Phaser GameScene with a collision layer for the ground and walls.name: phaser-gamedev description: "Build 2D games with Phaser 3 framework. Covers scene lifecycle, sprites, physics (Arcade/Matter), tilemaps, animations, input handling, and game architecture. Trigger: "create phaser game", "add phaser scene", "phaser sprite", "phaser physics", "game development with phaser"."
Phaser Game Development
Build 2D browser games using Phaser 3's scene-based architecture and physics systems.
STOP: Before Loading Any Spritesheet
Read spritesheets-nineslice.md FIRST.
Spritesheet loading is fragile—a few pixels off causes silent corruption that compounds into broken visuals. The reference file contains the mandatory inspection protocol.
Quick rules (details in reference):
- Measure the asset before writing loader code—never guess frame dimensions
- Character sprites use SQUARE frames: If you calculate frameWidth=56, try 56 for height first
- Different animations have different frame sizes: A run cycle needs wider frames than idle; an attack needs extra width for weapon swing. Measure EACH spritesheet independently
- Check for spacing: Gaps between frames require
spacing: Nin loader config - Verify the math:
imageWidth = (frameWidth × cols) + (spacing × (cols - 1))
Reference Files
Read these BEFORE working on the relevant feature:
| When working on... | Read first | |--------------------|------------| | Loading ANY spritesheet | spritesheets-nineslice.md | | Nine-slice UI panels | spritesheets-nineslice.md | | Tiled tilemaps, collision layers | tilemaps.md | | Physics tuning, groups, pooling | arcade-physics.md | | Performance issues, object pooling | performance.md |
Architecture Decisions (Make Early)
Physics System Choice
| System | Use When | |--------|----------| | Arcade | Platformers, shooters, most 2D games. Fast AABB collisions | | Matter | Physics puzzles, ragdolls, realistic collisions. Slower, more accurate | | None | Menu scenes, visual novels, card games |
Scene Structure
scenes/
├── BootScene.ts # Asset loading, progress bar
├── MenuScene.ts # Title screen, options
├── GameScene.ts # Main gameplay
├── UIScene.ts # HUD overlay (launched parallel)
└── GameOverScene.ts # End screen, restart
Scene Transitions
this.scene.start('GameScene', { level: 1 }); // Stop current, start new
this.scene.launch('UIScene'); // Run in parallel
this.scene.pause('GameScene'); // Pause
this.scene.stop('UIScene'); // Stop
Core Patterns
Game Configuration
const config: Phaser.Types.Core.GameConfig = {
type: Phaser.AUTO,
width: 800,
height: 600,
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH
},
physics: {
default: 'arcade',
arcade: { gravity: { y: 300 }, debug: false }
},
scene: [BootScene, MenuScene, GameScene]
};
Scene Lifecycle
class GameScene extends Phaser.Scene {
init(data) { } // Receive data from previous scene
preload() { } // Load assets (runs before create)
create() { } // Set up game objects, physics, input
update(time, delta) { } // Game loop, use delta for frame-rate independence
}
Frame-Rate Independent Movement
// CORRECT: scales with frame rate
this.player.x += this.speed * (delta / 1000);
// WRONG: varies with frame rate
this.player.x += this.speed;
Anti-Patterns
| Anti-Pattern | Problem | Solution |
|--------------|---------|----------|
| Global state on window | Scene transitions break state | Use scene data, registries |
| Loading in create() | Assets not ready when referenced | Load in preload(), use Boot scene |
| Frame counting | Game speed varies with FPS | Use delta / 1000 |
| Matter for simple collisions | Unnecessary complexity | Arcade handles most 2D games |
| One giant scene | Hard to extend | Separate gameplay/UI/menus |
| Magic numbers | Impossible to balance | Config objects, constants |
| No object pooling | GC stutters | Groups with setActive(false) |
Remember
Phaser provides powerful primitives—scenes, sprites, physics, input—but architecture is your responsibility.
Before coding: What scenes? What entities? How do they interact? What physics model?
Claude can build complete, polished Phaser games. These guidelines illuminate the path—they don't fence it.
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/phaser-game-development-mrx3xzyr/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/phaser-game-development-mrx3xzyr' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/phaser-game-development-mrx3xzyr/download' --output '.skill-downloads/phaser-game-development-mrx3xzyr/SKILL.md.part' && mv '.skill-downloads/phaser-game-development-mrx3xzyr/SKILL.md.part' '.skill-downloads/phaser-game-development-mrx3xzyr/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/phaser-game-development-mrx3xzyr/SKILL.md' && test -s '.skill-downloads/phaser-game-development-mrx3xzyr/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/phaser-gamedev' && cp -R '.skill-downloads/phaser-game-development-mrx3xzyr' '.claude/skills/phaser-gamedev'Cursor
test -f '.skill-downloads/phaser-game-development-mrx3xzyr/SKILL.md' && test -s '.skill-downloads/phaser-game-development-mrx3xzyr/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/phaser-gamedev' && cp -R '.skill-downloads/phaser-game-development-mrx3xzyr' '.cursor/skills/phaser-gamedev'Codex
test -f '.skill-downloads/phaser-game-development-mrx3xzyr/SKILL.md' && test -s '.skill-downloads/phaser-game-development-mrx3xzyr/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/phaser-gamedev' && cp -R '.skill-downloads/phaser-game-development-mrx3xzyr' '.agents/skills/phaser-gamedev'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/phaser-game-development-mrx3xzyr'openskills read 'phaser-game-development-mrx3xzyr'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/phaser-game-development-mrx3xzyr/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.