I am in the process of developing a game using Javascript that includes a leaderboard feature.
Originally, my plan was to allow players to enter their name and then click a button to start the game.
Since the game includes a countdown timer, I needed a way to save the player's score in two situations:
- When the timer runs out and the game ends
- When the player answers all questions correctly and completes the game
To save the player's information, I would send an object like this:
{
name: 'Fred Smith',
score: 14
}
My concern is whether this approach is feasible without requiring players to create an account through registration or login.
Each time a player participates, they would be submitting a new score and name, for example:
- If you set your player name as
Bob
- After your first game, a new object would be inserted into the database
- When you choose to
play again
, another object with the nameBob
and a new score would be posted
Since I am not very experienced with databases, I am unsure if this method would be sustainable in terms of database size, or if there is a more efficient approach that does not involve implementing registration or login functionalities.
Any advice would be greatly appreciated.