
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 pinned together at joints and animated with simple sine waves. It turned into one of our favorite experiments. Pull the live rig apart below, dress up a cat, or scrub through the animation cycle to see how the pieces fit together.
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, and silly hats are just Canvas paths and color fills, mixing 10 coats, 5 patterns, custom hex colors, 7 eye styles, 23 outfits, and 26 moods gives us millions of crisp cats without exporting a single PNG frame.
Under the Hood at a Glance
| Sprite Sheets Used | Zero (even the Kitty Chaos app icon is drawn from this same rig) |
| How Parts Connect | 15 layered body and outfit parts pinned together with Canvas transforms |
| Behaviors & Postures | 26 moods across 6 body shapes (standing, loaf, stretch, sleep ball, sunbathe, brawl) |
| Live Code Connection | Loads https://chaos.dualcorsoftware.com/rig/cat-rig.js directly from the live game |
| Sound Effects | Meows, purrs, and chirrups are synthesized in code too 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 around together, nap in sunbeams, chase lasers, get woozy on catnip, leap straight up when startled, hack up hairballs, and demand dinner at 60 FPS.