Kitty Chaos

Kitty Chaos

Behind the Code · 2D Rigged Animation

How 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.

Play Kitty Chaos
0 Sprite Sheets15 Rigged Parts26 Cat MoodsHTML5 Canvas + TypeScript

Interactive Cat Rig Sandbox

Running the real catRig.ts code from the game
CONNECTING TO LIVE GAME...0 Sprite Sheets · 15 Layered Parts · 26 Cat Moods
ViewportPlaying (Yarn Swat)
TOPOLOGY: uprightPHASE: 0.00 radOMEGA: 15.0 rad/sLAYERS: 15/15
SCRUB ANIMATION CYCLE (bobPhase)0.00 rad
PULL PARTS APART0%
The Sine Waves Behind the Motion
Body Bounce (px)Tail Wag (rad)

No keyframes needed: a couple of simple Math.sin waves bounce the body, wag the tail, and rock the paws in sync.

Bob Offset Y
0.00 px
Bob Amplitude
4.8 px
Jitter X
0.00 px
Breath Scale
1.000 x 1.000
Tail Wag
0.000 rad
Head Socket
(8, -34.0)
Head Tilt
0.000 rad
Ear Vertex
Upright
Trot Step
0.00 px
Blink Timer
2.50 s
Latest Game AnimationsClick to Preview
Playing (Yarn Swat)topology: upright

Rectified sine/cosine swatting trajectory on the front paw synchronized with a rolling, bouncing yarn prop.

Code Behind This Mood · Paw Batting Trajectory + Yarn Ball Propsrc/game/catRig.ts (playing)
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);
How the Parts Are Nested on Canvas
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

LESSON 01

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.

LESSON 02

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.

LESSON 03

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.

LESSON 04

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 UsedZero (even the Kitty Chaos app icon is drawn from this same rig)
How Parts Connect15 layered body and outfit parts pinned together with Canvas transforms
Behaviors & Postures26 moods across 6 body shapes (standing, loaf, stretch, sleep ball, sunbathe, brawl)
Live Code ConnectionLoads https://chaos.dualcorsoftware.com/rig/cat-rig.js directly from the live game
Sound EffectsMeows, purrs, and chirrups are synthesized in code too via the Web Audio API
Play in Browserhttps://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.

Play Kitty Chaos