How do you identify a player? Does he just pick his name from the list or does he have to enter it somewhere?And if other players want to play with the same name? That's cheating.
It's very important to identify the player. For this you can use either google services or firebase or another method of identification.
Once you have a unique identifier of your player you need to check the local storage, if there is such a key, then download.
I first used a file to store the username, user ID, and user password, and called that file using AJAX, storing the information in an array. When the user enters their ID and password, if it exists in the array, they log in successfully; otherwise, the login fails!
Currently, my method is to store multiple user attributes in JSON format in local storage, and I want to save the records when the user leaves or finishes the game. The next time they return to the game, the system can recognize the user and restore their multiple attributes.
How do I read the data stored in JSON format in local storage? There are still some issues that I haven't been able to resolve! Or would you recommend another method for storing and reading the data? Thank you very much!