Phaser home
Phaser AE
Open source
Phaser 4
Download
Learn
Editor
Tools
Docs
Examples
News
Log in
Examples
/
Animation
Phaser 4.1.0
Phaser 4 examples
Animation
47
examples
Examples
47
60fps Animation Test
Demonstrates creating and playing a sprite animation at 60 frames per second using a texture atlas, combined with scrolling tile sprites.
Add Animation Event
Demonstrates how to listen for the ADD_ANIMATION event to trigger a callback whenever a new animation is created in the Animation Manager.
Add Frames to Existing Animation
Learn how to dynamically add new frames to an animation after it has already been created and is currently being played by sprites.
Animation Complete Event
Listen for the animation complete event on a Sprite to trigger custom logic, such as spawning items or starting tweens, immediately after an animation finishes playing.
Animation from Multiple Atlases
Demonstrates how to create a single animation by sequencing frames that are distributed across multiple different texture atlases.
Animation from PNG Sequence
Create a looping animation using a series of individual image files and learn how to customize the duration of specific frames within the sequence.
Animation Playback and Frame Monitoring
Demonstrates how to play, pause, and restart animations while visualizing the current frame selection on the source spritesheet and monitoring playback progress metrics.
Animation Playback Progress
Demonstrates how to use the getProgress method to track the current playback state of a running animation, visualized using a graphics-based progress bar.
Animation Random Delay
Use the delay property when playing an animation to stagger the start times across multiple sprites.
Animation Repeat Event
Demonstrates how to listen for the animation repeat event to trigger logic, such as spawning objects, every time a sprite's animation completes a loop.
Animation Repeat Event
Demonstrates how to use the ANIMATION_REPEAT event to trigger logic, such as spawning items, every time a sprite's looping animation completes a cycle.
Animation Stop Event
This example demonstrates how to listen for the animation stop event on a sprite and trigger logic when an animation is manually halted.
Animation Update Event
Trigger specific actions or logic when an animation reaches a particular frame by listening for the animation update event.
Animation Yoyo Toggle
Demonstrates how to use the yoyo property to play an animation forwards and then in reverse, including how to toggle the effect at runtime.
Animations from JSON
Demonstrates how to define and batch-create multiple animations simultaneously using a single JSON configuration object.
Aseprite Animation Loading
Learn how to load Aseprite exported files, automatically generate animations from JSON tags, and play them on a sprite.
Chained Animation
Demonstrates how to queue multiple animations to play in sequence using the chain method and play after the current animation repeat finishes.
Create Animation From Canvas Texture
Demonstrates how to programmatically draw a sprite sheet onto a canvas texture, define individual frames from it, and use those frames to create a playable animation.
Create Animation From Sprite Sheet
Demonstrates how to create multiple animations by selecting specific frame indices from a loaded sprite sheet and playing them on a sprite.
Create Animation From Texture Atlas
Demonstrates how to generate animations by extracting specific frame sequences from a texture atlas using the generateFrameNames helper.
Create Animation Without Frame Names
Demonstrates how to create a sprite animation by passing a texture atlas key directly to the animation configuration, allowing Phaser to automatically extract and numerically sort all frames within that atlas.
Create Sprites from Config
Demonstrates creating multiple sprites using configuration objects that define randomized properties and complex animation behaviors like delayed playback and repeat delays.
Export Animation to JSON
Demonstrates how to export specific animations or the entire global animation manager configuration into a JSON format for saving or debugging.
Generate Animation Frame Numbers
Demonstrates different ways to define animation frames from a spritesheet, including using the entire sheet, specifying a range, or creating a custom sequence of frame indices.
Generate Frame Names
Demonstrates how to use the generateFrameNames method to automatically create animation frames from a texture atlas by specifying prefixes, suffixes, and zero-padding for sequenced frame names.
Hide Animation On Complete
Demonstrates how to use the hideOnComplete property to automatically hide a sprite once its animation finishes playing.
Load Animations from JSON
Demonstrates how to load animation definitions from an external JSON file and apply them to sprites using a texture atlas.
Local Sprite Animations
Demonstrates how to create animations directly on a specific Sprite, allowing it to have private animation keys that override global animations with the same name.
Mixed Animation Transitions
Demonstrates how to use animation mixing to define specific delay durations when transitioning between different sprite animations.
Multi Atlas Animation
Demonstrates how to load a multi-file texture atlas and create a sprite animation from its frames.
On Animation Start Event
Demonstrates how to use the ANIMATION_START event to trigger logic when a sprite begins a new animation, such as synchronizing background scrolling with a character's run cycle.
Pause All Animations
Demonstrates how to globally pause and resume every active sprite animation in the game using the Animation Manager.
Pause Animation Instances
Demonstrates how to pause an animation globally, which stops all sprites currently using that animation instance simultaneously.
Play Animation After Delay
Demonstrates how to schedule an animation to play after a specific delay in milliseconds using the playAfterDelay method.
Play Animation After Random Delay
Demonstrates how to use the playAfterDelay method to restart an animation after a random time interval once it has completed.
Play Animation After Repeat
Demonstrates how to use playAfterRepeat to queue an animation to start only after the current repeating animation completes its current loop, and how to chain subsequent animations.
Play Animation with Config Object
Demonstrates how to play an animation using a configuration object to override or extend global animation settings, such as frameRate and repeatDelay, on individual sprites.
Remove Animation Event
Demonstrates how to listen for the removal of an animation from the global Animation Manager and respond to the event.
Reverse Animation
Demonstrates how to control animation playback direction using playReverse, the reverse method, and yoyo toggling.
Show On Start
Demonstrates how to use the showOnStart property to automatically make a hidden Sprite visible the moment an animation begins playing.
Sprite Animation Events
Listen for and respond to animation lifecycle events, including start, update, repeat, and complete, to execute logic during a sprite's playback.
Staggered Animation Playback
Demonstrates how to use staggerPlay to trigger an animation across a group of sprites with an incremental time delay between each start.
Staggered Animation Playback
Demonstrates how to use staggerPlay to trigger an animation across a large collection of Sprites with an incremental delay between each start.
Staggered Animation Playback
Learn how to use staggerPlay to start animations on a group of sprites with an incremental time delay between each one, creating a wave-like visual effect.
Staggered Cube Animations
This example demonstrates how to use staggerPlay to trigger animations across a group of sprites with a time offset, combined with grid alignment and camera effects.
Start Animation from Random Frame
Demonstrates how to start playing an animation from a random frame in the sequence using the randomFrame configuration property.
Tweening Animation Time Scale
This example demonstrates how to use a tween to dynamically adjust the timeScale of a sprite animation, smoothly transitioning the playback speed over time.