Skip to content

Commit

Permalink
Update hud.js
Browse files Browse the repository at this point in the history
more refinement of variables.
  • Loading branch information
Patrick-W-McMahon committed Aug 5, 2015
1 parent e0f17b3 commit 50490de
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions examples/flappyBird/hud.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function HUD(){
var screenWidth;
var screenHeightHalf;
var screenWidthHalf;
var game_over_sign, score_board;
var game_over_sign;

this.init = function(e){
this.gameEngine = e;
Expand All @@ -26,11 +26,9 @@ function HUD(){
width:screenWidthHalf-180,
height:screenHeightHalf-100,
textX:screenWidthHalf-80,
textY:screenHeightHalf
}
score_board={
x:screenWidthHalf-80,
y:screenHeightHalf+40
textY:screenHeightHalf,
scoreX:screenWidthHalf-80,
scoreY:screenHeightHalf+40
}
}

Expand Down Expand Up @@ -61,7 +59,7 @@ function HUD(){
g.fillStyle = "white";
g.fillText("Game Over",game_over_sign.textX,game_over_sign.textY);
g.font="24px Verdana";
g.fillText("Score: "+this.playerOneScore,score_board.x,score_board.y);
g.fillText("Score: "+this.playerOneScore,game_over_sign.scoreX,game_over_sign.scoreY);
}
}
}

0 comments on commit 50490de

Please sign in to comment.