diff --git a/a2ow5l92js.js b/a2ow5l92js.js index 908a53a..fb3364d 100644 --- a/a2ow5l92js.js +++ b/a2ow5l92js.js @@ -437,6 +437,26 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { }; + this.drawScore = function(score) { + + var context = this.scoreCanvas.instance.getContext('2d'); + + context.textBaseline = "middle"; + + context.clearRect(0,0,this.scoreCanvas.width, this.scoreCanvas.height); + + /** + * Write text + */ + context.fillStyle = '#7e3b26'; + context.font = '230pt BkBold'; + context.fillText(score, 0, this.scoreCanvas.height/2); + + this.scoreTexture.instance.needsUpdate = true; + + }.bind(this) + + this.explode = function(mesh) { this.enemies.map( @@ -658,25 +678,6 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); } -this.drawScore = function() { - - var context = this.scoreCanvas.instance.getContext('2d'); - - context.textBaseline = "middle"; - - context.clearRect(0,0,this.scoreCanvas.width, this.scoreCanvas.height); - - /** - * Write text - */ - context.fillStyle = '#7e3b26'; - context.font = '20pt BkBold'; - context.fillText('10', 23, 52); - -}.bind(this) - - - this.totalTime += data.delta; this.enemySpawnTime += data.delta;