saveState working now, the falling blocks don't fall into clock now
This commit is contained in:
parent
a3d98180ea
commit
5a9ed8a17e
4 changed files with 10 additions and 3 deletions
2
js/0
Normal file
2
js/0
Normal file
|
@ -0,0 +1,2 @@
|
|||
Text.js:8: this.alive=1;
|
||||
Text.js:11: if(this.alive>0){
|
|
@ -138,6 +138,7 @@ function init() {
|
|||
spawnLane = 0;
|
||||
|
||||
gameState = -2;
|
||||
if(saveState.clock !== undefined) gameState = 1;
|
||||
|
||||
count = 0;
|
||||
|
||||
|
@ -154,6 +155,7 @@ function init() {
|
|||
|
||||
gdx = saveState.gdx || 0;
|
||||
gdy = saveState.gdy || 0;
|
||||
comboMultiplier = saveState.comboMultiplier || 0;
|
||||
|
||||
MainClock = saveState.clock || new Clock(settings.hexWidth);
|
||||
for(var i=0; i<MainClock.blocks.length; i++) {
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
var grey = '#bdc3c7';
|
||||
var op=0;
|
||||
var saveState = localStorage.getItem("saveState") || "{}";
|
||||
if(saveState !== "{}"){op=1;}
|
||||
function render() {
|
||||
ctx.clearRect(0, 0, trueCanvas.width, trueCanvas.height);
|
||||
clearGameBoard();
|
||||
if (gameState == 1) {
|
||||
if (gameState == 1 || gameState ==2) {
|
||||
if (op < 1) {
|
||||
op += 0.01;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ function exportSaveState() {
|
|||
wavegen: waveone,
|
||||
gdx: gdx,
|
||||
gdy: gdy,
|
||||
comboMultiplier:comboMultiplier
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue