diff --git a/a2ow5l92js.js b/a2ow5l92js.js index af462cf..908a53a 100644 --- a/a2ow5l92js.js +++ b/a2ow5l92js.js @@ -49,6 +49,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.leftLight = this.entityLoaded.leftLight; this.rightLight = this.entityLoaded.rightLight; this.scoreCanvas = this.entityLoaded.scoreCanvas; + this.scoreTexture = this.entityLoaded.scoreTexture; this.throwerLight = this.entityLoaded.throwerLight; this.fireParticleEngine = this.entityLoaded.fireParticleEngine; this.smokeParticleEngine = this.entityLoaded.smokeParticleEngine; @@ -663,7 +664,7 @@ this.drawScore = function() { context.textBaseline = "middle"; - context.clearRect(0,0,this.canvas.width, this.canvas.height); + context.clearRect(0,0,this.scoreCanvas.width, this.scoreCanvas.height); /** * Write text @@ -672,7 +673,9 @@ this.drawScore = function() { context.font = '20pt BkBold'; context.fillText('10', 23, 52); -} +}.bind(this) + + this.totalTime += data.delta; this.enemySpawnTime += data.delta; @@ -697,6 +700,8 @@ this.scene.meshes.map( if (this.mouseIsDown) { + this.drawScore(); + this.kanisterTime += data.delta; this.renderer.clearColor.r += 0.01;