diff --git a/a2ow5l92js.js b/a2ow5l92js.js index fb3364d..0ec5d0f 100644 --- a/a2ow5l92js.js +++ b/a2ow5l92js.js @@ -50,6 +50,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.rightLight = this.entityLoaded.rightLight; this.scoreCanvas = this.entityLoaded.scoreCanvas; this.scoreTexture = this.entityLoaded.scoreTexture; + this.scoreMesh = this.entityLoaded.scoreMesh; this.throwerLight = this.entityLoaded.throwerLight; this.fireParticleEngine = this.entityLoaded.fireParticleEngine; this.smokeParticleEngine = this.entityLoaded.smokeParticleEngine; @@ -72,10 +73,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.treesBurningToStart = GameLib.Utils.GetRandomIntInclusive(1, 3); this.running = false; - - /** - * This component is initializing - set the total time to 0 - */ + this.totalTime = 0; this.kanisters = 3; @@ -83,8 +81,6 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.kanisterLife = 16.344; this.kanisterLeakTime = 0.1; this.kanisterSpawnScore = 50; - - this.setNextKanisterSpawnScore = function() { @@ -171,6 +167,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.enemies = []; + this.scores = []; + this.enemiesSpawned = 0; this.fog.density = 0.01; @@ -437,8 +435,18 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { }; - this.drawScore = function(score) { + this.drawScore = function(enemy) { + /*var scoreMesh = this.scoreMesh.clone(); + scoreMesh.position = enemy.mesh.position.clone(); + + var scoreTexture = this.scoreTexture.clone(); + scoreMesh.materials[0].instance.map = scoreTexture.instance; + */ + + this.scoreMesh.position = enemy.mesh.position.clone(); + this.scoreMesh.updateInstance('position'); + var context = this.scoreCanvas.instance.getContext('2d'); context.textBaseline = "middle"; @@ -450,7 +458,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { */ context.fillStyle = '#7e3b26'; context.font = '230pt BkBold'; - context.fillText(score, 0, this.scoreCanvas.height/2); + context.fillText(enemy.score, 0, this.scoreCanvas.height/2); this.scoreTexture.instance.needsUpdate = true;