On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+1)

The game feels great, the concept is amazing and overall the visuals deliver what's needed without much distraction and the game feels cohesive in a really smooth way, also how does the leaderboard work?

                                                                      PLAYER

                                                                            :>

(+1)

Thanks for playing! The leaderboard is a Firebase project I set up that utilizes the Firestore Database service. In the database, I created a collection called leaderboard and each score is saved in the database as a document with two fields (player:STRING,score:NUMBER). Firestore has an option to query sorted data but I do all the sorting client side since I couldn't get it to work.

Displaying the leaderboard:
When someone completes the game it will log in anonymously into Firebase and ask for a list of all the documents in the leaderboard collection. In Godot with the SDK I'm using this will return an array of objects where I can access the fields stored in the document for each document in the database. This gets displayed as a list.

Updating the leaderboard:
When a player presses OK to submit their score the game will add a new document to the collection in the Firestore Database. The document name is the player's name and like stated before it will be initialized with two fields containing the user-submitted name and the score the game had been tracking. After it finishes doing this it makes a request to Firestore for all the documents in the collection again to display. It's untested, but the game is set up to automatically delete any scores that aren't in the top 30 from Firestore. It's a bit too much of a client-side implementation but I'm still pretty proud of it haha.

Firebase has a free tier which does limit how many reads and writes your application can make to Firestore but it hasn't been a problem for me yet (50k read limit a day, I got 300 ish reads yesterday, most from me lol).