devShop icon indicating copy to clipboard operation
devShop copied to clipboard

save the score

Open th3happybit opened this issue 5 years ago • 3 comments

can you please add the ability to save score state using a cookie or something

th3happybit avatar Nov 11 '19 13:11 th3happybit

localStorage should work fine for that

mikroskeem avatar Nov 12 '19 11:11 mikroskeem

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();

alekzs avatar Nov 18 '19 08:11 alekzs

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.

Lustyn avatar Nov 20 '19 08:11 Lustyn