In an online flash game, an easy way to display in real time the game bests performances (directly in the game or on a separate website) would be to use a firebase database.
The highscore being generated below in my example would be replaced by the actual score that people would get by playing the game.
And highscore is not the only thing you can display ! You can display many in game information here (such as the time played or the when this highscore was made) !
Moreover, Firebase has a Unity app integration. Meaning it would be even easier for game designers to add such a leaderboard in their game.
(Which is definitely something I need to try on one of my projects !)
Initially this generator was to show how to deal with game Highscores using a database
By lack of time to code it, I will just explain it :)
So here we have a random number generator associated with a name. When you fill in your name and submit, each name is associated with a number.
It is to simulate the highscore a player could get when ending a game.
I did simulate like this:
It creates a reference based on the name inputed. I make this reference an object and add to it both the name we inputed and the generated highscore (between 1 & 10000).
To display it we would just have to call it back from the database and sort all the player highscores based on their values.
json of few values I added for the example using the generator