The Trolley Problem: An Interactive Moral Experiment for Reddit

The Hook

See how closely your moral sensibilities align with the collective will of the internet. Make your choice, find out if Reddit agrees, and watch the community's majority vote dictate the final, inescapable outcome in real time - unless reddit changes it's mind.

Inspiration

The Trolley Problem is the internet's favourite philosophical meme, but flat images only take the debate so far. I wanted to transform it into a true collective experiment: an interactive game built directly inside your Reddit feed where your individual moral choice is immediately weighed against the greater public consensus.

Instead of just looking at stats or imagining in your head, I wanted players to feel the tension of the lever. You make your decision based on what you believe produces the best overall outcome, but you ultimately have to live with what the community decides. It introduces a fascinating psychological layer: the comments section will be filled with people defending their choices and/or dealing with the fallout of a community vote they fundamentally disagreed with.


What it does

"The Trolley Problem" is an interactive community-driven app built specifically for in-line Reddit feeds.

  • Make the Choice: Players encounter a trolley barrelling toward a junction. They can choose to do nothing (letting the trolley run down the default track) or pull the lever (diverting it to the alternate track).
  • Watch the Majority Rule: Here's the twist: the physics animation that plays out isn't necessarily what you chose. The trolley follows the path decided by the community's majority vote. You get to watch the real-time consequences of aggregate human data playing out on the tracks, whether it maximizes the preservation of life or veers into absurd, chaotic territory.
  • The Verdict Popup After you witness the carnage of the community's actions, a screen pops up to deliver the verdict: "Reddit Agrees!" or "Reddit Disagrees!", immediately revealing the exact percentage breakdown of how the community voted.
  • Creator Hub: Anyone can design a custom dilemma to test the internet's ethics. Describe who goes on the tracks, upload custom images, or sketch directly onto the canvas with a built-in drawing board. Publish it instantly to see what the internet values most.

How I built it

The frontend game engine is built using Phaser 3 and Vite for smooth, responsive animations. The backend is powered by Devvit (Reddit’s Developer Platform), hosting our serverless logic and handling API routes via Hono. We use Redis to store and instantly update the global voting data, ensuring that every player’s choice immediately impacts the live community percentage and the resulting animation.


Challenges I ran into

  • Subreddit Scrolling: Originally, loading a game engine inside a Reddit post blocked users from scrolling past it on their feed. I had to rewrite the event handling to ensure that scrolling past the post feels completely normal on desktop and mobile. This was especially difficult for the creator section, which required multiple redesigns to feel good and not overflow on desktop or phone.
  • Mobile Drawing & Cropping: Designing custom canvas drawing tools and image cropping that works perfectly inside a mobile Reddit iframe took a lot of fine-tuning, especially calculating touch coordinates accurately on different screen sizes.

What I learnt

I learnt how to design interactive elements that respect the natural flow of browsing social media. Building for Devvit taught me how to optimise storage for custom drawings and images using compressed data URLs to keep load times lightning-fast, which is essential for preventing the app from being an instant scroll over.


What's next for The Trolley Problem

I want to add real-time leaderboards to rank the people who are most and least agreed with. Additionally, if usage grows enough I'd like to add daily streaks and rewards for playing which can give you currency that lets you change things on the map like custom trams, switch buttons, and tracks. I've already made several changes since the original submission to improve the gameplay feel, UI, added a daily problem system that posts a pre-generated dilemma, as well as updated various wordings to better align with the reddit rules.

Share this project:

Updates