Hello, goose
<script type="module" src="pixel-sprite.js"></script><pixel-sprite src="goose-root.bundle.json" size="128" alt="root, a goose in a hoodie"></pixel-sprite><pixel-sprite src="pip.bundle.json" anim="walk" size="128" alt="Pip walking"></pixel-sprite><pixel-sprite src="fox.bundle.json" anim="trot" size="128" alt="Ember the fox trotting"></pixel-sprite><pixel-sprite src="slime.bundle.json" anim="hop" size="96" alt="a hopping slime"></pixel-sprite><pixel-sprite src="moss.bundle.json" anim="think" size="128" click-anim="hop" alt="Moss thinking"></pixel-sprite>Click the goose: its bundle carries a small state machine, so it honks; hover it and it starts hacking.
How it fits together
Section titled “How it fits together”- Write a character as JSON: materials, parts with shapes, animations. Start from a figure (goose, human, dog, chibi, blob) and its motion models do the walking, jumping and climbing. Writing a character
- Bake a bundle: one JSON file with sprite sheets at 16, 32 and 64 px plus events, attachment points and the foot line.
npx pixel bundle goose.json. Bundles - Play it with
<pixel-sprite>, drive it with a state machine, move it with the shared clock, or let it loose on the page with<pixel-stage>.
Topics
Section titled “Topics”Putting a sprite on a pageSizes, detail levels, hover and click, playback API, fallbacks.
Events, points and the foot lineFootsteps, speech bubbles at the beak, standing on an edge, hit testing.
State machines and skinsSet a speed, fire a honk; party hats and team colours.
Moving spritesWalk without sliding, climb, jump along an arc.
Characters on the pageWalking on cards, climbing, sitting on edges, hiding behind things.
Writing a characterLive spec playgrounds: shapes, materials, tracks, figures.
Figures and motionsEvery figure and motion, rendered; tune parameters live.
Bundles and game enginesThe bundle format, CLI, PixiJS and Phaser.
Every option and format is in the reference.