What inspired it

I wanted a game I could play in a Reddit feed in about ten seconds, no instructions. The physics games I actually like are single-player and a little lonely. Reddit posts are the opposite. People argue in the replies, they upvote the good ones, it's social by default.

So: a trick-shot game where the shot is small enough to fit inside a comment. Two numbers, angle and power. Once a shot is that small, anyone who sees your score can replay the exact thing you did. Honestly the rest of the game is decoration around that one idea.

How I built it

It's a Devvit Web app. The game is Phaser in an iframe on reddit.com, the backend is a small Hono server on Devvit's runtime, and there's a third piece that matters more than either of those: a physics core that both sides import and run.

Every subreddit gets one procedurally generated rig per day. Three shots each. Scores go on a leaderboard, and since a shot is just {angle, power} plus the rig, you can paste it into a comment and anyone can watch it back.

The daily rig has no scheduled job behind it, which I didn't expect going in. The seed is just hash(subredditId + date), computed the first time someone opens the post that day. Nothing runs at midnight, so nothing can fail to run at midnight.

The client runs the sim locally so aiming feels instant, but that result never counts. The server runs the same sim and its answer is the only one that gets stored. The client's number gets thrown away every time.

The hard part

The physics had to come out byte-identical on Node, desktop Chrome, and mobile Safari. If they drift apart even a little, a replay someone posts in a comment can visibly disagree with the score attached to it, and the whole premise dies on the spot.

I lost a good chunk of the hackathon here. I ended up building a separate littl harness that does nothing but run the sim on my phone and my laptop at the same time and diff the trajectories. But the fix wasn't making floats match everywhere, which I'm not sure is even possible. It was making the score not depend on that. I only count discrete events, and I cap how many bounces score per segment, so a tiny numerical difference has nowhere to turn into a different number on the board.

Cheating was the other one. Three shots a day has to mean three. I do it with a atomic Redis increment that I check after incrementing, and a rejected shot still eats the counter. Trust the client's UI to count and someone replays a burst of shots to farm the leaderboard.

What I learned

The determinism thing reframed the whole project for me. As long as I was trying to force floats to agree across devices I was stuck. The day I flipped it and made the score not care, everything downstream got simpler.

And "Reddit-y" turned out to be nothing like Reddit theming. No snoo, no karma currency, none of that. The actual Reddit-native bit is that a shot fits in a comment, so the comment section quietly becomes the replay feed. That whole behavior fell out of one stubborn constraint: keep a shot down to two numbers.

Built With

Share this project:

Updates

Submission history