Saving the player's progress
Polish in games is not always about the visual embellishments. Sometimes it's also about adding smaller features that aren't immediately noticeable but can drastically improve the overall experience. Currently the game looks good and plays well, but if we close down the browser and return to play at a later time, we will need to start all over again. Players these days expect that they can come back to a game and continue from where they left off. In order to do this, we need to save the player's progress.
Understanding local storage
Whenever a game needs to save data the only viable option is to write the data to a file outside of the game itself. This poses a potential problem for web-based games as any file that needs to be downloaded will require the user to explicitly allow it. This would mean the player would know the name of the file and where it is located, which in turn would mean they could easily hack their own saved file. To get around this hurdle,...