mirror of
https://github.com/danbulant/bobek
synced 2026-07-05 11:00:50 +00:00
UI.curr removed for github pages
This commit is contained in:
parent
a07681c3b5
commit
6df46c628e
1 changed files with 16 additions and 12 deletions
28
game.js
28
game.js
|
|
@ -216,26 +216,30 @@
|
||||||
curr : 0,
|
curr : 0,
|
||||||
best : 0,
|
best : 0,
|
||||||
},
|
},
|
||||||
curr : undefined,
|
x :0,
|
||||||
|
y :0,
|
||||||
|
tx :0,
|
||||||
|
ty :0,
|
||||||
frame : 0,
|
frame : 0,
|
||||||
draw : function() {
|
draw : function() {
|
||||||
switch (state.curr) {
|
switch (state.curr) {
|
||||||
case state.getReady :
|
case state.getReady :
|
||||||
this.curr = this.getReady;
|
this.y = parseFloat(scrn.height-this.getReady.sprite.height)/2;
|
||||||
|
this.x = parseFloat(scrn.width-this.getReady.sprite.width)/2;
|
||||||
|
this.tx = parseFloat(scrn.width - this.tap[0].sprite.width)/2;
|
||||||
|
this.ty = this.y + this.getReady.sprite.height- this.tap[0].sprite.height;
|
||||||
|
sctx.drawImage(this.getReady.sprite,this.x,this.y);
|
||||||
|
sctx.drawImage(this.tap[this.frame].sprite,this.tx,this.ty)
|
||||||
break;
|
break;
|
||||||
case state.gameOver :
|
case state.gameOver :
|
||||||
this.curr = this.gameOver;
|
this.y = parseFloat(scrn.height-this.gameOver.sprite.height)/2;
|
||||||
|
this.x = parseFloat(scrn.width-this.gameOver.sprite.width)/2;
|
||||||
|
this.tx = parseFloat(scrn.width - this.tap[0].sprite.width)/2;
|
||||||
|
this.ty = this.y + this.gameOver.sprite.height- this.tap[0].sprite.height;
|
||||||
|
sctx.drawImage(this.gameOver.sprite,this.x,this.y);
|
||||||
|
sctx.drawImage(this.tap[this.frame].sprite,this.tx,this.ty)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
let y = parseFloat(scrn.height-this.curr.sprite.height)/2;
|
|
||||||
let x = parseFloat(scrn.width-this.curr.sprite.width)/2;
|
|
||||||
if(state.curr!=state.Play)
|
|
||||||
{
|
|
||||||
let tx = parseFloat(scrn.width - this.tap[0].sprite.width)/2;
|
|
||||||
let ty = y + this.curr.sprite.height- this.tap[0].sprite.height;
|
|
||||||
sctx.drawImage(this.curr.sprite,x,y);
|
|
||||||
sctx.drawImage(this.tap[this.frame].sprite,tx,ty)
|
|
||||||
}
|
|
||||||
this.drawScore();
|
this.drawScore();
|
||||||
},
|
},
|
||||||
drawScore : function() {
|
drawScore : function() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue