mirror of
https://github.com/danbulant/bobek
synced 2026-06-19 06:11:08 +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() {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
|
|
|||
Loading…
Reference in a new issue