From cc69f30ba3196fe49e11ad04056f2422388e56a7 Mon Sep 17 00:00:00 2001 From: Abdelrahman Tarek Date: Wed, 23 Oct 2019 02:15:28 +0200 Subject: [PATCH] merge --- game.js | 19 +++++++++++-------- index.html | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/game.js b/game.js index 01133b7..0ba99fb 100644 --- a/game.js +++ b/game.js @@ -257,16 +257,18 @@ drawScore : function() { sctx.fillStyle = "#FFFFFF"; sctx.strokeStyle = "#000000"; - switch (state.curr) { - case state.Play : + if(state.curr == state.Play ) + { sctx.lineWidth = "2"; sctx.font = "35px Squada One"; sctx.fillText(this.score.curr,scrn.width/2,50); sctx.strokeText(this.score.curr,scrn.width/2,50); - break; - case state.gameOver : - this.score.best = Math.max(this.score.curr,localStorage.getItem("best")); - localStorage.setItem("best",this.score.best); + } + if(state.curr == state.gameOver ) + { + + //this.score.best = Math.max(this.score.curr,localStorage.getItem("best")); + //localStorage.setItem("best",this.score.best); sctx.lineWidth = "2"; sctx.font = "40px Squada One"; let sc = `SCORE : ${this.score.curr}` @@ -275,8 +277,9 @@ sctx.strokeText(sc,scrn.width/2-80,scrn.height/2); sctx.fillText(bs,scrn.width/2-80,scrn.height/2+30); sctx.strokeText(bs,scrn.width/2-80,scrn.height/2+30); - break; - } + + + } } }; diff --git a/index.html b/index.html index a87f074..7c4d753 100644 --- a/index.html +++ b/index.html @@ -1,3 +1,4 @@ +