
Kitty Chaos
Behind the Code · 2D Rigged AnimationHow we animated millions of unique cats without drawing a single sprite sheet.
When we started building Kitty Chaos, we realized traditional sprite sheets would box us in fast. Every new coat pattern, heterochromia eye option, wizard hat, or goofy mood would have meant multiplying hundreds of hand-drawn animation frames.
Instead, we treated each cat like a tiny rigged puppet built straight out of code: ovals, triangles, rounded rectangles, and Bezier curves with warm Storybook ink outlines pinned together at joints. The same vector pipeline now drives all 4 rooms (including the Chef's Kitchen) and 21 3-beat Side Gig animations. Pull the rig apart below, switch into the Side Gigs tab, or scrub any animation cycle to inspect how it works.
Interactive Cat Rig Sandbox
No keyframes needed: a couple of simple Math.sin waves bounce the body, wag the tail, and rock the paws in sync.
Rectified sine/cosine swatting trajectory on the front paw synchronized with a rolling, bouncing yarn prop.
const batX = c.facing * (14 + Math.abs(Math.sin(c.bobPhase * 2.2)) * 9);
const batY = 3 - Math.abs(Math.cos(c.bobPhase * 2.2)) * 6;
ctx.ellipse(batX, batY, 7.5, 5, 0, 0, Math.PI * 2);
const yarnRoll = Math.abs(Math.sin(c.bobPhase * 1.9)) * 15;
ctx.translate(c.facing * (25 + yarnRoll), 6 - Math.abs(Math.sin(c.bobPhase * 3.8)) * 4);
ctx.rotate(yarnRoll * 0.18 * c.facing);World(x, y)
+-- Shadow(x, y + 10) [stays on the floor]
+-- Root(x + vibX, y + sin(bobPhase) * 4.8)
+-- Tail(-20*f, -10) -> rotate(0.00 rad)
+-- Torso [upright] + BellyPatch
+-- Paws [walk / swat / groom]
+-- Neckwear(neckX, neckY)
+-- Head(8, -34.0) -> rotate(0.00 rad)
+-- Ears [upright] + Markings
+-- Gaze(faceX = 2px) -> Eyes + Mouth + Glasses
+-- Hat(0, -21)One Cat, Eight Moods at Once
Try changing the fur colors, eyes, or hat in the Dress Up tab above. Every single animation updates automatically without redrawing a single frame.
What We Learned Building Cats Out of Code
Parent-Child Joints Beat Frame Tables
When a cat tilts its head out of curiosity or curls up for a nap, we never manually line up its crown, glasses, ears, or whiskers. Because everything on the face is drawn inside the head's Canvas transform (ctx.translate and ctx.rotate), the whole face and outfit ride along automatically.
One Timer Drives the Whole Body
You do not need a heavy keyframe timeline to make a character feel alive. Each cat keeps one running counter (bobPhase) that speeds up during zoomies or startle jumps, slows down when woozy on catnip, and snaps between wide-eyed WHARK strains and tense gulp pauses during hairballs.
Swap Shapes Instead of Stretching Them
Real cats are basically liquid, so trying to bend one standing oval into a cat loaf or a curled sleep ball looked terrible. The trick was swapping the torso shape completely for big posture changes (standing oval, rounded loaf rectangle, arched stretch, or breathing sleep ball) and re-pinning the head and tail.
Pure Code Means Millions of Cats for Free
Because coats, calico patches, tuxedo masks, odd-eyed irises, cel shading, and props are just Canvas paths and color fills, mixing 10 coats, 5 patterns, custom hex colors, 7 eye styles, 23 outfits, and 27 moods gives us millions of crisp cats without exporting a single PNG frame.
Outer-First Strokes & Clipped Markings
In vectorStyle.ts, thick outer ink strokes (#4a3525, or #1f1713 with rim highlights on dark fur) are drawn behind inner fills so lineweight stays uniform. Fur patches draw inside ctx.clip() without bleeding over edges, and the silhouette path is re-traced after ctx.restore() before stroking.
Layering 21 Side Gigs on One Rig
A lightweight RigGigPoseOverride lets all 21 room-specific Side Gigs reuse one rig across pancake, belly-up, rearing, hunter, and back-turn poses, temporary chef toques or shades, and 3-beat prop sequences (drawGigBackProps, rig, drawGigFrontProps) with zero OS emojis.
Under the Hood at a Glance
| Sprite Sheets Used | Zero (every cat, room, prop, and even the app icon is Canvas 2D vector code) |
| How Parts Connect | 15 layered body and outfit parts pinned together with Canvas transforms |
| Behaviors & Side Gigs | 27 moods + 21 3-beat Side Gig animations across 6 body shapes |
| Rooms & Props | 4 vector rooms (Living Room, Sunlit Catio, Home Office, Chef's Kitchen) + Cardboard Box props |
| Live Code Connection | Loads https://chaos.dualcorsoftware.com/rig/cat-rig.js directly from the live game |
| Sound Effects | Meows, purrs, chirrups, and chatters are synthesized in code via the Web Audio API |
| Play in Browser | https://chaos.dualcorsoftware.com |
Watch a Whole House Full of Them Go Wild
In the actual game, dozens of these rigged cats wander across 4 interactive rooms, knead biscuits in the Chef's Kitchen, perform 21 prop-driven Side Gigs, hop in Cardboard Boxes, chase lasers, and demand dinner at 60 FPS.