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

Play Kitty Chaos
0 Sprite Sheets15 Rigged Parts27 Cat Moods21 Side Gigs4 Vector RoomsHTML5 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 · 27 Moods · 21 Side Gigs
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, 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.

LESSON 05

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.

LESSON 06

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 UsedZero (every cat, room, prop, and even the app icon is Canvas 2D vector code)
How Parts Connect15 layered body and outfit parts pinned together with Canvas transforms
Behaviors & Side Gigs27 moods + 21 3-beat Side Gig animations across 6 body shapes
Rooms & Props4 vector rooms (Living Room, Sunlit Catio, Home Office, Chef's Kitchen) + Cardboard Box props
Live Code ConnectionLoads https://chaos.dualcorsoftware.com/rig/cat-rig.js directly from the live game
Sound EffectsMeows, purrs, chirrups, and chatters are synthesized in code 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 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.

Play Kitty Chaos