mirror of
https://github.com/danbulant/bobek
synced 2026-07-06 11:30:43 +00:00
merge
This commit is contained in:
parent
9ec86ee63e
commit
cc69f30ba3
2 changed files with 12 additions and 8 deletions
19
game.js
19
game.js
|
|
@ -257,16 +257,18 @@
|
||||||
drawScore : function() {
|
drawScore : function() {
|
||||||
sctx.fillStyle = "#FFFFFF";
|
sctx.fillStyle = "#FFFFFF";
|
||||||
sctx.strokeStyle = "#000000";
|
sctx.strokeStyle = "#000000";
|
||||||
switch (state.curr) {
|
if(state.curr == state.Play )
|
||||||
case state.Play :
|
{
|
||||||
sctx.lineWidth = "2";
|
sctx.lineWidth = "2";
|
||||||
sctx.font = "35px Squada One";
|
sctx.font = "35px Squada One";
|
||||||
sctx.fillText(this.score.curr,scrn.width/2,50);
|
sctx.fillText(this.score.curr,scrn.width/2,50);
|
||||||
sctx.strokeText(this.score.curr,scrn.width/2,50);
|
sctx.strokeText(this.score.curr,scrn.width/2,50);
|
||||||
break;
|
}
|
||||||
case state.gameOver :
|
if(state.curr == state.gameOver )
|
||||||
this.score.best = Math.max(this.score.curr,localStorage.getItem("best"));
|
{
|
||||||
localStorage.setItem("best",this.score.best);
|
|
||||||
|
//this.score.best = Math.max(this.score.curr,localStorage.getItem("best"));
|
||||||
|
//localStorage.setItem("best",this.score.best);
|
||||||
sctx.lineWidth = "2";
|
sctx.lineWidth = "2";
|
||||||
sctx.font = "40px Squada One";
|
sctx.font = "40px Squada One";
|
||||||
let sc = `SCORE : ${this.score.curr}`
|
let sc = `SCORE : ${this.score.curr}`
|
||||||
|
|
@ -275,8 +277,9 @@
|
||||||
sctx.strokeText(sc,scrn.width/2-80,scrn.height/2);
|
sctx.strokeText(sc,scrn.width/2-80,scrn.height/2);
|
||||||
sctx.fillText(bs,scrn.width/2-80,scrn.height/2+30);
|
sctx.fillText(bs,scrn.width/2-80,scrn.height/2+30);
|
||||||
sctx.strokeText(bs,scrn.width/2-80,scrn.height/2+30);
|
sctx.strokeText(bs,scrn.width/2-80,scrn.height/2+30);
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue