animations

Create and control sprite animations in Phaser 4 using spritesheets, atlases, and animation events.

2|10|Updated Jul 28, 2026
One-click install
npx skills add https://github.com/kodingvibes/gamejam-2026 --skill animations-kodingvibes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: animations
Source: https://github.com/kodingvibes/gamejam-2026/tree/main/participantes/jpyunism/.agents/skills/animations
Command: npx skills add https://github.com/kodingvibes/gamejam-2026 --skill animations-kodingvibes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing sprite animations in Phaser 4 involves two distinct systems (the global AnimationManager and per-sprite AnimationState), plus many configuration options and events that are easy to misuse. This Skill provides the correct patterns for creating, playing, chaining, and debugging animations so you avoid common pitfalls like duplicate animation warnings or infinite loops that never complete. ## Core Features & Use Cases - Animation Creation: Build animations from spritesheets with generateFrameNumbers, from texture atlases with generateFrameNames, or directly from Aseprite JSON exports. - Playback Control: Play, reverse, pause, resume, stop, chain, and stagger animations, with support for yoyo, repeat, per-frame durations, and timeScale speed control. - Events & Callbacks: React to animationstart, animationcomplete, animationupdate, and key-specific events to trigger game logic at exact frames. - Use Case: You are building a platformer character. Use this Skill to define walk/idle/attack animations from a spritesheet, chain attack into idle on completion, and fire a hit-check callback when the attack animation reaches frame 4. ## Quick Start Ask the AI to create a Phaser 4 sprite animation from a spritesheet and play it with a completion event that chains into an idle animation.

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. Finally call sprite.play with the animation key to start playback.

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

AnimationManager (this.anims) is a global singleton that stores animation definitions shared across all scenes. AnimationState (sprite.anims) lives on each sprite and controls playback for that specific game object, with local animations taking priority over global ones.

How do I play animations from a texture atlas in Phaser?▼

Use this.anims.generateFrameNames with the atlas key and a config specifying prefix, start, end, and zeroPad to match frame names like ruby_0001. Then pass the result as the frames array in this.anims.create.

Why does animationcomplete never fire for my Phaser animation?▼

Animations with repeat set to -1 loop forever and never complete naturally, so animationcomplete never fires. Call sprite.anims.stop() to end them and listen for the animationstop event instead.

Does Phaser 4 support Aseprite animations?▼

Yes. Load the Aseprite files with this.load.aseprite, then call this.anims.createFromAseprite with the texture key to generate animations from all tags or a specified subset. Play them by tag name with sprite.play.

How do I chain multiple animations in Phaser?▼

Call sprite.chain with a key or array of keys after sprite.play. Chained animations start after the current one completes or stops, and you can clear the queue by calling sprite.anims.chain() with no arguments.