Added a visible score counter to the bottom of the screen
This commit is contained in:
@@ -124,6 +124,13 @@ GameState.prototype.create = function()
|
|||||||
this.fpsText = this.game.add.text(
|
this.fpsText = this.game.add.text(
|
||||||
20, 20, '', { font: '16px Arial', fill: '#ffffff' }, this.uigroup
|
20, 20, '', { font: '16px Arial', fill: '#ffffff' }, this.uigroup
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this.score = 0;
|
||||||
|
this.scoreText = this.game.add.text(
|
||||||
|
SCREEN_WIDTH - 80, SCREEN_HEIGHT - 40, '',
|
||||||
|
{ font: '16px Arial', fill: '#ffffff' }, this.uigroup
|
||||||
|
);
|
||||||
|
|
||||||
this.lightbox = this.game.add.image(game.camera.width / 2 - 50,
|
this.lightbox = this.game.add.image(game.camera.width / 2 - 50,
|
||||||
game.camera.height - 40,
|
game.camera.height - 40,
|
||||||
'lightbox',
|
'lightbox',
|
||||||
@@ -345,6 +352,7 @@ GameState.prototype.update = function()
|
|||||||
this.fpsText.setText(game.time.fps + ' FPS');
|
this.fpsText.setText(game.time.fps + ' FPS');
|
||||||
}
|
}
|
||||||
this.clockText.setText("" + this.clock.getHours() + ":" + this.clock.getMinutes() + ":" + this.clock.getSeconds());
|
this.clockText.setText("" + this.clock.getHours() + ":" + this.clock.getMinutes() + ":" + this.clock.getSeconds());
|
||||||
|
this.scoreText.setText("" + this.score);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Boot()
|
function Boot()
|
||||||
|
|||||||
Reference in New Issue
Block a user