PH

phaser-gamedev

Assists with Phaser 3 scene creation, physics tuning, sprite loading, and game architecture implementation.

Install

mkdir -p .claude/skills/phaser-gamedev && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/12050" && unzip -o skill.zip -d .claude/skills/phaser-gamedev && rm skill.zip

Installs to .claude/skills/phaser-gamedev

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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\".
286 charsno explicit “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Build 2D browser games using Phaser 3
  • Manage scene lifecycle (init, preload, create, update)
  • Implement physics systems (Arcade or Matter)
  • Handle animations and input
  • Load spritesheets with mandatory inspection protocol

How it works

The skill guides the creation of Phaser 3 games by defining scene structure, physics systems, and asset loading protocols, emphasizing frame-rate independent movement and avoiding common anti-patterns.

Inputs & outputs

You give it
Game assets, scene logic, and configuration parameters
You get back
A 2D browser game built with Phaser 3

When to use phaser-gamedev

  • Create new Phaser scene
  • Set up physics for sprites
  • Implement game input handling

About this skill

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):

  1. Measure the asset before writing loader code—never guess frame dimensions
  2. Character sprites use SQUARE frames: If you calculate frameWidth=56, try 56 for height first
  3. 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
  4. Check for spacing: Gaps between frames require spacing: N in loader config
  5. 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 spritesheetspritesheets-nineslice.md
Nine-slice UI panelsspritesheets-nineslice.md
Tiled tilemaps, collision layerstilemaps.md
Physics tuning, groups, poolingarcade-physics.md
Performance issues, object poolingperformance.md

Architecture Decisions (Make Early)

Physics System Choice

SystemUse When
ArcadePlatformers, shooters, most 2D games. Fast AABB collisions
MatterPhysics puzzles, ragdolls, realistic collisions. Slower, more accurate
NoneMenu 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-PatternProblemSolution
Global state on windowScene transitions break stateUse scene data, registries
Loading in create()Assets not ready when referencedLoad in preload(), use Boot scene
Frame countingGame speed varies with FPSUse delta / 1000
Matter for simple collisionsUnnecessary complexityArcade handles most 2D games
One giant sceneHard to extendSeparate gameplay/UI/menus
Magic numbersImpossible to balanceConfig objects, constants
No object poolingGC stuttersGroups 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.

When not to use it

  • When loading any spritesheet without first reading `spritesheets-nineslice.md`
  • When using Matter physics for simple AABB collisions
  • When using global state on `window` for scene transitions

Limitations

  • Requires careful measurement of spritesheet assets before loading
  • Architecture decisions like physics system choice and scene structure are the developer's responsibility

How it compares

This skill provides structured guidance for Phaser 3 game development, including specific protocols for asset loading and architecture decisions, which is more prescriptive than general game development tutorials.

Compared to similar skills

phaser-gamedev side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
phaser-gamedev (this skill)03moNo flagsIntermediate
threejs-skills614moNo flagsIntermediate
3d-graphics336moNo flagsAdvanced
threejs-shaders46moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

threejs-skills

sickn33

Three.js skills for creating 3D elements and interactive experiences

61152

3d-graphics

samhvw8

3D web graphics with Three.js (WebGL/WebGPU). Capabilities: scenes, cameras, geometries, materials, lights, animations, model loading (GLTF/FBX), PBR materials, shadows, post-processing (bloom, SSAO, SSR), custom shaders, instancing, LOD, physics, VR/XR. Actions: create, build, animate, render 3D scenes/models. Keywords: Three.js, WebGL, WebGPU, 3D graphics, scene, camera, geometry, material, light, animation, GLTF, FBX, OrbitControls, PBR, shadow mapping, post-processing, bloom, SSAO, shader, instancing, LOD, WebXR, VR, AR, product configurator, data visualization, architectural walkthrough, interactive 3D, canvas. Use when: creating 3D visualizations, building WebGL/WebGPU apps, loading 3D models, adding animations, implementing VR/XR, creating interactive graphics, building product configurators.

33104

threejs-shaders

CloudAI-X

Three.js shaders - GLSL, ShaderMaterial, uniforms, custom effects. Use when creating custom visual effects, modifying vertices, writing fragment shaders, or extending built-in materials.

430

gsap

martinholovsky

GSAP animations for JARVIS HUD transitions and effects

318

threejs-animation

CloudAI-X

Three.js animation - keyframe animation, skeletal animation, morph targets, animation mixing. Use when animating objects, playing GLTF animations, creating procedural motion, or blending animations.

57

threejs-lighting

CloudAI-X

Three.js lighting - light types, shadows, environment lighting. Use when adding lights, configuring shadows, setting up IBL, or optimizing lighting performance.

14

Search skills

Search the agent skills registry