mirror of
https://github.com/danbulant/bobek
synced 2026-06-17 13:21:34 +00:00
Done no SFX
This commit is contained in:
parent
5b8df8727b
commit
129ef1c15d
2 changed files with 7 additions and 5 deletions
12
game.js
12
game.js
|
|
@ -21,10 +21,6 @@
|
|||
|
||||
let frames = 0;
|
||||
let dx = 2;
|
||||
const score = {
|
||||
curr : 0,
|
||||
best : 0
|
||||
}
|
||||
const state = {
|
||||
curr : 0,
|
||||
getReady : 0,
|
||||
|
|
@ -69,6 +65,7 @@
|
|||
top : {sprite : new Image()},
|
||||
bot : {sprite : new Image()},
|
||||
gap:85,
|
||||
moved: true,
|
||||
pipes : [],
|
||||
draw : function(){
|
||||
for(let i = 0;i<this.pipes.length;i++)
|
||||
|
|
@ -91,7 +88,7 @@
|
|||
if(this.pipes.length&&this.pipes[0].x < -this.top.sprite.width)
|
||||
{
|
||||
this.pipes.shift();
|
||||
UI.score.curr++;
|
||||
this.moved = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -190,6 +187,11 @@
|
|||
}
|
||||
|
||||
}
|
||||
else if(pipe.moved)
|
||||
{
|
||||
UI.score.curr++;
|
||||
pipe.moved = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
BIN
img/gameover.png
BIN
img/gameover.png
Binary file not shown.
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.5 KiB |
Loading…
Reference in a new issue