Have a problem. I create my game object like this:
var game_status = {
money : 350000000,
reset_status : function() {
this.money = 350000000;
}
}
function saveGame(){
localStorage.setItem('game_status', JSON.stringify(game_status));
}
function loadGame(){
game_status = JSON.parse(localStorage.getItem('game_status'));
}
After loading game status method "reset_status" doesn't exists anymore.
Probably I should describe object, create instance, save instance, and then loading creating instance anew with parameters from load?