
Animations
Handles sprite animation in Phaser 4 through the global AnimationManager and per-sprite AnimationState. Covers the usual workflow of loading spritesheets or atlases, creating animation definitions with frame sequences, and controlling playback with play, pause, chain, and reverse methods. The skill explains the local vs global animation distinction, yoyo and repeat patterns, animation mixing for transitions, and the full event system including frame-level callbacks. If you're building anything with character movement, effects, or UI animations in Phaser, this gives you the complete reference for timing, sequencing, and responding to animation lifecycle events.
- skills.sh installs
- 1.2K
- GitHub stars
- 40.7K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add phaserjs/phaser --skill animations --agent claude-codeInstalls into .claude/skills of the current project.
Files
Phaser 4 -- Sprite Animations
AnimationManager (global), AnimationState (per-sprite), creating animations from spritesheets and atlases, playing/pausing/chaining, animation events, frame callbacks.
Related skills: ../sprites-and-images/SKILL.md, ../loading-assets/SKILL.md
Quick Start
// In preload -- load a spritesheet
this.load.spritesheet('explosion', 'explosion.png', {
frameWidth: 64,
frameHeight: 64
});
// In create -- define a global animation
this.anims.create({
key: 'explode',
frames: this.anims.generateFrameNumbers('explosion', { start: 0, end: 11 }),
frameRate: 24,
repeat: 0
});
// Play it on a sprite
const sprite = this.add.sprite(400, 300, 'explosion');
sprite.play('explode');
Core Concepts
AnimationManager vs AnimationState
Phaser has two distinct animation objects:
Sponsors
Details
- Repository
- github.com/phaserjs/phaser
- Categories
- Design & UI/UX, Game Development
- First seen
- Jun 3, 2026