how do I store the amount of clicks they have earned in the game, how do make it so that others see other people’s scores, and how do i prevent cheating?
If someone could please reach out to me that would be great!
That explains how to use localStorage to save data so you can close the browser and then reopen it - “cookies”.
If you want to have shared state among multiple users then you need server-side persistence, and ~hello-sqlite might be helpful - instead of reading and writing dreams, you would be reading and writing the high-scores table.
Preventing cheating in incremental games is pretty hard; essentially you would record the sequence of choices that the player made (when the player bought what), and you would re-run the simulation on the server-side, but faster. Then you award them, not the number of points that they claim they earned, but the number of points that the server-side simulation says that they earned.
Hope this helps,