Last active
August 29, 2015 14:04
-
-
Save ecoleman/50eed4879f02469a4e5b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// load the `gameState` param from localStorage and convert it from JSON to an object | |
var game = JSON.parse(localStorage.getItem("gameState")); | |
// after the above line, you can type `game` in your console to see what properties it has | |
// change the `game.stores.wood` param to 15 | |
game.stores.wood = 15; | |
// re-encode the game state into json and update localStorage | |
localStorage.setItem("gameState", JSON.stringify(game)); | |
// reload the current window | |
window.location.reload(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment