Open RGonzalezTech opened 8 months ago
This one blocks #22
I should implement the high score system before I review the systems that are in-place and create their documentation.
So far, I've implemented a singleton / autoload class that will load and save the list of leaderboard entries to a .json
file in the user://
directory. This will allow us to persist it. We will only store the top 10 leaderboard entries, any other are ignored/omitted.
To add a UI for this, we require:
checkIfQualifiedEntry(score) -> bool
function that will tell us if the score makes it to be displayed in the leaderboardaddEntry(score, label, time) -> void
function that will add and sort the entry to the list.
Summary
We can store this information in some form of cache, if available. The game is primarily meant to publish to HTML/Browser. I can test working with the web
JavascriptBridge
to write tolocalStorage
, oruser://
to store serialized data. Not sure which would be best/workable.