falling blocks dont continue falling on refresh

This commit is contained in:
Garrett Finucane 2014-06-23 23:12:38 -04:00
parent 2c3b9cbba0
commit c2498cdf11
2 changed files with 8 additions and 6 deletions

View file

@ -298,11 +298,10 @@ function animLoop() {
}
else if (gameState === 0) { //start screen
requestAnimFrame(animLoop);
if (importing) {
update();
}
render();
debugger;
if (importing) {
update();
}
render();
}
else if (gameState == -2) { //initialization screen just before starting
requestAnimFrame(animLoop);

View file

@ -1,7 +1,10 @@
function exportSaveState() {
var state = {};
if(gameState == 1 || gameState == -1 || gameState == 0) {
if(gameState == 1 || gameState == -1 || (gameState == 0 && localStorage.getItem('saveState') !== undefined)) {
debugger
MainClock.blocks.map(function(block){block.distFromHex /= settings.scale});
blocks.map(function(block){block.distFromHex /= settings.scale})
state = {
clock: MainClock,
blocks: blocks,