Windows Desktop Pet & Procedural Animation App
Lazy Cat Companion
A Code-Drawn Desktop Cat for Windows That Naps, Purrs and Leaps to Your Clicks
- GitHub stars: 2
- Downloads: 5
- v0.3.0 · 1 month ago
A tiny desktop cat for Windows 10 & 11 that naps in the corner of your screen, wakes with a stretch and a yawn when double-clicked, closes its eyes happily under your cursor as hearts float up, turns and leaps to any spot you click on the wallpaper, and can be carried around by the scruff. Modeled on Raisul Sohan's own brown tabby-and-white cat, it is drawn entirely in code with C#, WPF and .NET 10—no images or sprite sheets: every pose is a set of a few dozen numbers, so every movement blends smoothly into the next and the coat can be any color.
The challenge
Desktop pets are usually a handful of fixed sprite frames: they snap from one pose to the next, come in one color, and feel lifeless. The goal was a cat that looks like the developer's own cat and genuinely feels alive—breathing, blinking, twitching its ears, watching the cursor—without ever getting in the way of real work.
Core Technical Challenges:
1. Drawing a Whole Cat Without Images: a brown tabby-and-white coat with mackerel stripes, green eyes, big tufted ears, a dark-tipped tail and a black collar, built purely from geometry and brushes so every part can bend and blend into any pose, with fur edges that never read as a clean cut-out.
2. Smooth Pose-to-Pose Motion: blending between sleeping, sphinx, stretching, sitting, crouching, mid-air leaping, landing, dangling by the scruff and eleven ways of sitting without knees flipping or the tail sweeping through the floor.
3. Telling Wallpaper Clicks from Work: leaping only for clicks on the desktop wallpaper, never for clicks inside other windows, while clicks on the transparent space around the cat still reach the app underneath.
4. Staying Light: an animated window that is open all day must not burn CPU or battery, and must install without administrator rights or a separate .NET runtime.
The solution
1. Parametric Poses & Field-by-Field Blending: every pose (CatPose) is a few dozen numbers—hip, chest, head, the four feet, ears, eyes, mouth, tail angle and curl. Two poses blend field by field along an ease-in-out curve, so any pose morphs smoothly into any other; when the tail swings between behind and in front it is drawn short, as if pointing at the viewer, so it never sweeps through the floor.
2. A Coat Drawn in Code: a bendable capsule body, a tileable grain of 1,600 tiny hairs, hash-seeded fur tufts along every edge (so they never flicker), mackerel stripes, eyes with iris fibers, and an 18-segment tail. Legs use two-bone inverse kinematics (the knee placed by the law of cosines), always bending to the same side so they can never snap across.
3. Layered Signs of Life: breathing, blinking, ear twitches, tail swishes and following the cursor are layered over the pose clips; a nearby cursor widens the pupils into hunting mode, and resting on the cat sends up a heart every half second. Leaps size their height and duration from the distance, lean into the direction of travel and squash on landing.
4. Transparent Window & Smart Click Detection: the cat lives in a transparent, topmost WPF window where everything but the drawn cat passes clicks through to the app underneath. A low-level mouse hook runs only while the cat is awake, and WindowFromPoint confirms that a click landed on the desktop wallpaper (Progman/WorkerW) before the cat leaps.
5. Performance & Installer: 60 FPS only while leaping or being carried, 30 FPS otherwise and 15 FPS asleep; even the sleeping z is built once as geometry. Ships as a self-contained, compressed single EXE in a per-user Inno Setup installer, with no administrator rights or separate .NET install needed.
6. Tray Menu & Built-in Demo Renderer: the tray icon is drawn from the cat's own face; its menu picks a way of sitting, the coat (tabby & white, 10 plain colors or a custom one), the size and which way it faces. A --render-demo mode runs a 15-second storyboard on a mock desktop through the app's own renderer, producing every frame of the demo and the cues for its synthesized soundtrack.
Highlights
- Double-click to wake it: a stretch, a big yawn, then a tidy sit; floating z's while it sleeps
- Pet it with the cursor for happy closed eyes and floating hearts
- Click the wallpaper and it turns, wiggles and leaps to the spot in an arc
- Carry it by the scruff and drop it anywhere on the screen
- Eleven ways of sitting, from paw licking and leg-up grooming to lounging like a person
- Drawn entirely in code with C#, WPF and .NET 10: no sprites, any coat color
- No administrator rights, light on CPU, and 100% free and open source (MIT)
