animations

Create and control sprite animations in Phaser 4 using AnimationManager and AnimationState.

Updated Jul 13, 2026
One-click install
npx skills add https://github.com/russellmorgan/UnderConstruction --skill animations-russellmorgan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: animations
Source: https://github.com/russellmorgan/UnderConstruction/tree/main/.claude/skills/animations
Command: npx skills add https://github.com/russellmorgan/UnderConstruction --skill animations-russellmorgan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Phaser 4 splits animation logic between a global AnimationManager and per-sprite AnimationState, which confuses developers about where to define animations, how playback priority works, and why events like animationcomplete never fire for looping animations. This Skill provides the correct patterns, configuration tables, and gotchas so animations work the first time. ## Core Features & Use Cases - Animation Creation: Define animations from spritesheets with generateFrameNumbers, from atlases with generateFrameNames, or from Aseprite JSON exports. - Playback Control: Play, reverse, pause, stop, chain, stagger, and mix animations with per-sprite or global timeScale control. - Events & Frame Callbacks: React to animationstart, animationupdate, animationcomplete, and key-specific events for gameplay triggers like hit detection on a specific frame. - Use Case: You are building a character that plays an attack animation, triggers a hit check on frame 4, then chains back to idle. This Skill gives you the exact play, chain, and animationupdate patterns to implement it. ## Quick Start Ask the AI to create a looping walk animation from a spritesheet in Phaser 4 and play it on a sprite with a completion callback.

Frequently Asked Questions about animations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a sprite animation in Phaser 4?▼

Load a spritesheet in preload with this.load.spritesheet, then call this.anims.create with a key, frames from generateFrameNumbers, frameRate, and repeat. Play it on a sprite with sprite.play('key').

What is the difference between AnimationManager and AnimationState in Phaser?▼

AnimationManager is a global singleton accessed via this.anims that stores animation definitions shared across all scenes. AnimationState lives on each sprite as sprite.anims and controls playback for that specific Game Object.

How do I animate from a texture atlas in Phaser 4?▼

Use this.anims.generateFrameNames with the atlas key and a config specifying prefix, start, end, and zeroPad to match frame names like ruby_0001. Calling it with no config returns all frames in the atlas.

Why does animationcomplete not fire for my Phaser animation?▼

Animations with repeat: -1 loop forever and never fire animationcomplete. Call sprite.anims.stop() to end them, which fires animationstop instead, and listen for that event.

Does Phaser 4 support Aseprite animations?▼

Yes. Load the Aseprite file with this.load.aseprite, then call this.anims.createFromAseprite with the key and optional tag list. Animations are created per tag and played by tag name.

How do I chain animations in Phaser after one finishes?▼

Call sprite.chain('idle') after sprite.play('attack') to queue the next animation, or pass an array to chain multiple. Chained animations start after animationcomplete or animationstop on the current one.