You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will allow users to continue the game even if they close their browser/tab
What needs to be saved?
Some sort of user id, we don't want a full login system yet so we'll have to generate a UUID for him and save it
It's 2017, we don't care about browsers not supporting LocalStorage, so no cookie workarounds 😄
The game needs to be paused when leaving the app and the state must be persisted
This is required because otherwise you will reload the game and the timer will start immediately and it will be confusing
Every move a user makes needs to be saved
This will be easier in the long term than just saving a snapshot of the game, we can implement replays for example or even (wait for it) have some sort of async multiplayer mode
This needs to be light so a format like [ [0,'r'], [1, 'l'], [3, 'u'], [2, 'd'] ] should be used (tile index 0 to 14 and direction 'r' = 'right', etc...
On new game we can clear the history until we have a backend to save them (way long term)
We'll need full 100% unit-test coverage for this functionality because it will be very easy to break stuff and it's very hard to debug local storage issues
Also need to take care of users having inconsistent data in local storage due to application bugs
There are literally dozens of LocalStorage libs out there, need to research on which one is the lightest and suits our needs
The text was updated successfully, but these errors were encountered:
Hitting reload will make you lose your progress, this sucks. Have a confirmation dialog (browser dialog is good enough).
No need to use a LocalStorage lib, just use the API directly
Hitting reload should check if there is a game currently in progress, and if yes, load it, but start in pause mode so the timer doesn't just keep going
We don't need a user id, a lot has changed in 6 years, people hate tracking nowadays 🥲
[ [0,'r'], [1, 'l'], [3, 'u'], [2, 'd'] ]
should be used (tile index 0 to 14 and direction 'r' = 'right', etc...The text was updated successfully, but these errors were encountered: