Done no SFX

This commit is contained in:
Darkin 2019-10-19 18:47:33 +02:00
parent 5b8df8727b
commit 129ef1c15d
2 changed files with 7 additions and 5 deletions

12
game.js
View file

@ -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;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB