diff options
Diffstat (limited to 'game/states/play.js')
-rw-r--r-- | game/states/play.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/game/states/play.js b/game/states/play.js index 49c6cca..84237a6 100644 --- a/game/states/play.js +++ b/game/states/play.js @@ -43,6 +43,9 @@ Play.prototype = { this.addPlayerControls(); this.game.physics.startSystem(Phaser.Physics.ARCADE); + + this.playerAScoreText = this.game.add.bitmapText(-0.1, -0.4, 'scorefont','0',1); + this.playerBScoreText = this.game.add.bitmapText(this.world.width/100 - 2.1, -0.4, 'scorefont','0',1); }, update: function() { this.game.physics.arcade.overlap(this.players, this.pills, this.playerPillCollision, null, this); @@ -179,7 +182,8 @@ Play.prototype = { player.score++; pill.destroy(); - console.log('A: ' + this.playerA.score + ' B: ' + this.playerB.score); + this.playerAScoreText.setText(this.playerA.score+''); + this.playerBScoreText.setText(this.playerB.score+''); } }; |