2014-05-26 01:59:33 +00:00
|
|
|
function exportSaveState() {
|
2014-06-24 13:23:43 +00:00
|
|
|
console.log('o')
|
2014-05-26 03:52:35 +00:00
|
|
|
var state = {};
|
2014-06-24 04:15:03 +00:00
|
|
|
|
2014-06-24 03:12:38 +00:00
|
|
|
if(gameState == 1 || gameState == -1 || (gameState == 0 && localStorage.getItem('saveState') !== undefined)) {
|
2014-06-24 13:42:38 +00:00
|
|
|
|
|
|
|
MainClock.blocks.forEach(function(o){
|
|
|
|
o.forEach(function(b){
|
|
|
|
b.distFromhex /= settings.scale;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
2014-06-24 03:12:38 +00:00
|
|
|
blocks.map(function(block){block.distFromHex /= settings.scale})
|
2014-05-26 03:52:35 +00:00
|
|
|
state = {
|
|
|
|
clock: MainClock,
|
|
|
|
blocks: blocks,
|
|
|
|
score: score,
|
|
|
|
wavegen: waveone,
|
|
|
|
gdx: gdx,
|
|
|
|
gdy: gdy,
|
2014-05-31 14:55:36 +00:00
|
|
|
comboMultiplier:comboMultiplier
|
2014-05-26 03:52:35 +00:00
|
|
|
}
|
2014-05-26 01:59:33 +00:00
|
|
|
}
|
|
|
|
|
2014-05-26 03:52:35 +00:00
|
|
|
return JSONfn.stringify(state);
|
|
|
|
}
|
2014-05-26 05:11:13 +00:00
|
|
|
|
|
|
|
function clearSaveState() {
|
|
|
|
localStorage.setItem("saveState", "{}");
|
|
|
|
}
|
|
|
|
|
|
|
|
function isStateSaved() {
|
|
|
|
return localStorage.getItem("saveState") != "{}";
|
2014-05-30 23:06:16 +00:00
|
|
|
}
|