Give an existing enemy a new animation, using files and one config entry and no code. About 15 minutes. The full rules are in character-assets.md.
The example adds a two-frame taunt to CrimeGuy, played when he gets back up
after being knocked down.
In Illustrator, draw each frame on its own artboard, at the same size as his other
poses. Name the body-part groups the way his other files do (front-glove,
back-shoe, …), so every frame has the same parts.
Export each artboard as SVG with Object IDs: Layer Names, into
assets/characters/enemy/:
CrimeGuy_taunt_0.svg
CrimeGuy_taunt_1.svg
Name them exactly like that, case included. Frames start at _0 and run without
gaps.
In config/enemy-assets.json, under "enemies" → "CrimeGuy" → "animations", add:
"taunt": { "mode": "sequence", "suffixes": ["taunt"] }
"taunt" has no file of its own (CrimeGuy_taunt.svg), so it expands to the
numbered run CrimeGuy_taunt_0.svg, _1.svg. A third frame later needs only the
file.
Reload the game, open debug mode, spawn a crimeguy, knock him down (an uppercut
does it, Up + J), and watch him get up: the taunt plays before he rejoins the
fight. The browser console warns if a named file cannot be found.
"walk": { "mode": "yoyo", "suffixes": ["walk"] }
with CrimeGuy_walk_0.svg to _4.svg plays 0 1 2 3 4 3 2 1."preDefeat") pulls in
all of its frames.js/entities/enemy.js; see character-assets.md.jacket-light, jacket-mid,
jacket-dark), then spawn { "enemy": "CrimeGuy", "render": { "jacket": "gray" } }
from a level design’s pool; see character-assets.md.
config/debug/renders.html shows every frame recolored beside the original.The full tables are in character-assets_cheatsheet.md.