Inspiration

I got inspired by the pixelary gameplay, which has this asynchronous gameplay where you don't have to be active all the time to play the game and I thought I should make something similar but with a different concept or game.

What it does

It's a community trivia game where every player will get five attempts at the event's beginning and a community goal of 30 points. Every correct answer is equivalent to 1 point. The event can be changed whenever the mod(me) changes it. When a user guesses a correct answer it'll generate a shout-out post for that user(from the app's account). The post has the question number and username of the person who answered the question with the correct answer and a small direction that will direct other users to play the game.

How I built it

I used Reddit's framework "Devvit" for this job since it's best suitable for maintaining a consistence experience between different devices on Reddit platform. I read the docs and created a blank app with the blocks and then started building my app. I also joined Devvit Discord to communicate with fellow hackers.

Challenges I ran into

  1. Animation Blocks doesn't support animations so I had to find another way to create animations for loading screen. so I just made a GIF with a loading animation and threw it on the loading screen.
  2. API limit Since the API is called on the server side, the limit(which in my case is one call per 5 seconds) was exceeding pretty fast. so to tackle this, Instead of fetching a question for every user individually I fetched 50 questions at the time of the event creation and stored them on Redis.
  3. Managing complex data structure in Redis when fetching the questions which are in JSON format I had to store them as a string in Redis and to keep track of answered and unanswered questions I made a sorted set with question number as a member and question status(answered & unanswered) as status(0=unanswered 1=unanswered).
    1. Custom font Since Devvit doesn't support custom fonts I just used an image.
    2. Constrained framework I come from a react background and it was a challenge for me to work with blocks because of it's constraining nature and I had to be more creative to find ways around to solve a particular problem.

Accomplishments that I'm proud of

I'm proud that I challenged myself by using blocks instead of react through web view, and created this game on a platform I used for years but didn't know I could make cool stuff on it.

What I learned

I gained knowledge regarding Devvit's operation. I gained knowledge on how to work within a limited framework and how to discover ways to complete tasks within those constraints.

What's next for Trivia Time

I want to add some more features like a message feature which will send a private message to all the participant when the event ends. and I'm planning to make it just like Pixelary and attract a large user base. I would work on it after the hackathon as well

Built With

  • blocks
  • devvit
Share this project:

Updates