askill
phaser-gamedev

phaser-gamedevSafety 95Repository

Build 2D browser games with Phaser 3 (JS/TS): scenes, sprites, physics (Arcade/Matter), tilemaps (Tiled), animations, input. Trigger: 'Phaser scene', 'Arcade physics', 'tilemap', 'Phaser 3 game'.

0 stars
1.2k downloads
Updated 2/20/2026

Package Files

Loading files...
SKILL.md

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
Config, scenes, objects, input, animationscore-patterns.md
Tiled tilemaps, collision layerstilemaps.md
Physics tuning, groups, poolingarcade-physics.md
Performance issues, object poolingperformance.md

Architecture Decisions (Make Early)

Before building, decide:

  • What scenes does this game need? (Boot, Menu, Game, UI overlay, GameOver)
  • What are the core entities and how do they interact?
  • What physics model fits? (Arcade for speed, Matter for realism, None for menus)
  • What input methods? (keyboard/gamepad/touch)

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

Core Principles

  1. Scene-first architecture: Organize code around scene lifecycle and transitions
  2. Composition over inheritance: Build entities from sprite/body/controllers, not deep class trees
  3. Physics-aware design: Choose collision model early; don't retrofit physics late
  4. Asset pipeline discipline: Preload everything; reference by keys; keep loading deterministic
  5. Frame-rate independence: Use delta for motion and timers; avoid frame counting

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)

Variation Guidance

Outputs should vary based on:

  • Genre (platformer vs top-down vs shmup)
  • Target platform (mobile touch, desktop keyboard, gamepad)
  • Art style (pixel art scaling vs HD smoothing)
  • Performance envelope (many sprites → pooling; few sprites → simpler code)

Remember

Phaser provides powerful primitives—scenes, sprites, physics, input—but architecture is your responsibility.

Think in systems: define the scenes, define the entities, define their interactions—then implement.

Codex can build complete, polished Phaser games. These guidelines illuminate the path—they don't fence it.

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

58/100Analyzed 2/24/2026

A comprehensive but internal Phaser 3 development guide emphasizing architecture decisions, best practices, and anti-patterns. Well-structured with tables and clear warnings, but lacks step-by-step implementation instructions and depends on external reference files not included in the skill itself. The .codex path and internal file references indicate this is tailored to a specific project rather than being a broadly reusable skill. Tags are mismatched (ci-cd for game dev)."

95
80
60
55
50

Metadata

Licenseunknown
Version-
Updated2/20/2026
PublisherMineru98

Tags

ci-cd