devShop
devShop copied to clipboard
save the score
can you please add the ability to save score state using a cookie or something
localStorage should work fine for that
For anyone wanting to save... you can do it by opening the browser console and typing this:
// Save
localStorage.setItem('game', JSON.stringify(game));
// Load
game = JSON.parse(localStorage.getItem('game')); drawRoom();
Local storage won't be sufficient for saving the game. The reason being, my current game actually takes up 11MB. IndexedDB is more fitting for this purpose and can just be used in the same way as localStorage using a polyfill like localForage.