One warm spot. Every cat wants it.

Sunbeam is a daily game for a whole subreddit. Each day there is one living room, shared by everyone who opens the post. A patch of sunlight drifts across the floor from sunrise to sunset. You are a cat. Get into the sun, stay in it, and knock everyone else out.

What it does

  • Flick your cat. Press anywhere, pull back, let go. Your cat slides across the floor, bounces off the furniture, scatters the toys and shoves any cat in its way.
  • Soak up warmth. A cat resting in the sunlight earns warmth for as long as it stays there, including while you are away from Reddit.
  • Three zoomies a day. After the first, your cat dashes from wherever it is sitting, so a zoomie can be a long charge or a short hop back into the light. The sun keeps moving, so the best seat in the morning is in the shade by noon. When you spend your zoomies matters as much as how you aim them.
  • Everyone is in the same room. The other cats are the other redditors, each under their username in one of eight coats. If you are in the room together, you watch each other's launches as they happen.
  • Biscuit lives there. The house cat follows the sun, and ten minutes after you bonk him out he comes back for his spot, so there is a rival even when you are the first to arrive.

A new room every day

  • A new room opens at 15:00 UTC with new furniture, a new rug, new toys, a new window and a new path for the sun. It is built from the day number, so everyone gets the same room and no two days are alike.
  • Today's room is pinned to the top of the community.
  • At sunset the room posts its results as a pinned comment and hands out user flair: Warmest cat, Top bonker and Bonk magnet.
  • Playing on consecutive days builds a streak.

How it is built

  • Devvit Web, TypeScript and a 2D canvas. There is no game engine and no image file: every cat, sofa and rug is drawn in code, and the sounds are synthesised in the browser.
  • The rules are pure functions shared by the server and the browser, with movement written so the same launch gives the same result on every machine. Only the launch itself (two numbers) travels over the network, and each browser replays it.
  • The server decides every launch inside a Redis transaction, so two cats launched at the same moment cannot disagree about who hit whom. A realtime channel carries launches to everyone in the room.
  • The scheduler opens the next room each day. If it ever misses, the first visitor after sunset opens it instead.

Challenges

  • Making a shared, physical room fair when players are rarely online together. The answer was to make time the opponent: the sun moves all day, zoomies are scarce, and warmth keeps counting while you are away.
  • Keeping the browser and the server in exact agreement. Any drift shows up as a cat that jumps after it lands, so the movement uses fixed steps and only arithmetic that gives identical results everywhere.
  • Teaching a flick with almost no words: your cat waits inside a ring, and a looping hand shows the pull.

What's next

  • A time-lapse of what happened in the room while you were away.
  • A coat picker, and more rooms of the house.

Built With

Share this project:

Updates

Submission history