Inspiration

Reddit's heartbeat is "Karma," yet most users don't realize the massive scale of engagement happening across different communities. We wanted to create a game that turns the act of browsing Reddit into a competitive trivia challenge. Karma Clash was born from a simple question: Can you actually predict what the internet will love?

What it does

Karma Clash is a daily "Higher or Lower" trivia game.

  1. The Matchup: Every day, the game fetches trending posts from diverse subreddits (like r/aww, r/pics, or r/gaming).
  2. The Goal: Players are shown two posts side-by-side and must guess which one earned more upvotes.
  3. The Reveal: The game uses real-time Karma counts. If you're correct, the numbers pop with a satisfying animation; if you're wrong, you learn just how unpredictable Reddit can be.
  4. Social Competition: At the end, users get a "Karma IQ" score (e.g., 4/5) and can instantly share their results in the comments to challenge others.

How we built it

We utilized Devvit Web and React to build a high-performance, mobile-optimized experience.

  • The Engine: We built a custom backend using Hono to bridge the gap between our React frontend and Reddit’s native data.
  • Live Integration: Unlike static games, we used the @devvit/public-api to pull live data. The game loop calculates accuracy using:

  • Dynamic UI: We used CSS3 animations to create a "Battle Arena" feel, with an adaptive layout that fits perfectly within the Reddit mobile app.

Challenges we faced

The biggest hurdle was moving from hardcoded mock data to the live Reddit API. We had to ensure that the asynchronous data fetching from reddit.getTopPosts was synchronized with the React state to prevent "layout shift." We also optimized the linter configuration to handle floating promises in our score-sharing clipboard logic.

Accomplishments that we're proud of

We successfully implemented a fully automated daily refresh. Because we pull from a randomized pool of subreddits, the game provides a fresh, relevant challenge every single day without needing a single manual update.

What we learned

Building on the Reddit Developer Platform taught us the importance of "Social-First" design. A game on Reddit isn't just about the mechanics; it's about the conversation it starts in the comment section.

Built With

Share this project:

Updates