Install Player-animator, Version 0.9.9 Or Later. Link May 2026

import Player from 'https://unpkg.com/player-animator@0.9.9/index.js'; Let’s animate a simple sprite sheet. Assume you have a sprite sheet character.png with 4 frames (each 32×32 pixels) in a row.

// Loop forever loop: true,

// Auto start playing autoplay: true }); install player-animator, version 0.9.9 or later.

// Speed: frames per second fps: 12,

// Frame size frameWidth: 32, frameHeight: 32, import Player from 'https://unpkg

// 2. Draw the current frame on each animation tick player.onFrame = (frameIndex) => { const sx = (frameIndex % 4) * 32; // X offset in sprite sheet const sy = 0; // Frame size frameWidth: 32