Inspiration

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for Tiltyard

Inspiration

The wooden marble labyrinth is one of the few toys you understand before you touch it. I wanted that feeling as a daily game: no reading, one gesture, and a puzzle that gets properly hard when two or three marbles start blocking each other. Because the whole solution is just a short list of tilts, it is also something a community can share and compare exactly: "nine tilts" means the same thing for everyone, and anyone's run can be replayed.

What it does

  • One tray a day. At midnight UTC the app posts the day's puzzle. Swipe, press the arrow keys or use the on-screen pad to tilt; every marble rolls until a block, the rim or another marble stops it. Park each marble on the ring of its colour.
  • A week that ramps up. Monday is a single marble on a 5×5 tray. By Sunday there are three marbles of different colours on a 7×7 tray and eleven tilts to find. Seven levels.
  • Par is the true minimum. Every tray is solved exhaustively on the server, so par is exactly the fewest tilts possible. Par earns three stars, up to two over earns two.
  • Watch how they did it. After you solve the day's tray, the result card lists the top players with a play button next to each: their run is replayed on your tray, tilt by tilt. Runs are only sent to players who have already solved it, so nothing is spoiled.
  • A community result card. Your place today, the share of players behind you, the star spread, your streak, a one-tap spoiler-free result line for the comments, and a countdown to tomorrow.
  • Streaks and flair. Solve on the day to keep the streak; at 3, 7, 14 and 30 days the app sets streak flair in the community.
  • Undo, restart and "Go for par". A bump against a wall that moves nothing is not counted as a tilt. Solved it the long way round? One tap restarts the tray to chase par.
  • The post is the invitation. In the feed the post shows the real tray, the solver count, and your finished position and stars if you are done. Logged-out visitors can play straight away.

How I built it

  • Devvit Web: React and a single SVG tray on the client, Hono on the server, Redis for state, the scheduler for the daily post, onAppInstall for the first one, user flair for streaks, an HTML launch screen plus an expanded entry point.
  • One shared engine (src/shared/engine.ts) for the physics of a tilt, breadth-first search and generation. The client uses it for moves and replays; the server replays every submitted run before it reaches the leaderboard.
  • Generation by search. The server scatters blocks and marbles, explores every position reachable from the start, and places the cups on a position that is exactly the target number of tilts away. That makes par exact by construction. Boards that can be solved by simply spinning the tray in a circle are thrown away.
  • Marble motion is plain CSS: each marble is an SVG group whose transform is transitioned, and the tray leans a few degrees in 3D on every tilt.
  • Devvit Journeys are instrumented (app ready, journey start on the first tilt, progress as cups fill, end with the star count), firing only on committed actions.
  • Tests. Unit tests cover rolling and stacking, the solver, and 140 generated trays checked for determinism, exact par and the no-spin rule. The game was also played end to end by a script in a local preview and inside the real post on Reddit.

Challenges

  • Cheap solutions. Early boards could often be solved by tilting clockwise in a circle. The generator now rejects any tray where a simple spin gets there.
  • Marbles that block each other. The order in which marbles move within one tilt matters; the engine always rolls the ones nearest the low edge first, and the animation follows the same result.
  • Replays without spoilers. The server only includes other players' runs in responses to players who already have a result on that puzzle.
  • One gesture, three inputs. Swipes are committed on release with a distance threshold, the keyboard and the on-screen pad call the same function, and the page never scrolls under the finger.

What I'm proud of

You can explain it in one sentence, play it with one thumb, and still get stuck for five minutes on a Sunday. And once you are done, the best part is watching someone else's run and seeing the move you missed.

What's next

  • Player-built trays posted as their own posts.
  • A weekly ladder across the seven daily trays.
  • New pieces on harder days: holes, one-way gates, sticky felt.

Built With

Share this project:

Updates

Submission history