gnd updated

This commit is contained in:
Darkin 2019-10-19 19:44:32 +02:00
parent 91639aea8b
commit 59d9526777

17
game.js
View file

@ -47,18 +47,8 @@
sctx.drawImage(this.sprite,this.x,this.y); sctx.drawImage(this.sprite,this.x,this.y);
}, },
update : function() { update : function() {
if(state.curr != state.Play) return;
switch (state.curr) { this.x -= dx;
case state.getReady :
this.x -= 1;
break;
case state.Play :
this.x -= dx
break;
case state.gameOver :
this.frame = 0;
break;
}
this.x = this.x % (this.sprite.width/2); this.x = this.x % (this.sprite.width/2);
} }
}; };
@ -303,8 +293,9 @@ gameLoop();
sctx.fillRect(0,0,scrn.width,scrn.height) sctx.fillRect(0,0,scrn.width,scrn.height)
bg.draw(); bg.draw();
pipe.draw(); pipe.draw();
gnd.draw();
bird.draw(); bird.draw();
gnd.draw();
UI.draw(); UI.draw();
} }