Update: CC - Before Render - Moorcow (zo950m57cc.js) 8596 bytes modified
parent
4857306bc9
commit
de18511abc
|
@ -1,9 +1,9 @@
|
|||
|
||||
if (!this.entityLoaded) {
|
||||
if (!this.entityLoaded) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||
if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||
|
||||
this.initialized = true;
|
||||
|
||||
|
@ -219,25 +219,22 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
|||
|
||||
this.getNextMesh = function(meshType) {
|
||||
|
||||
var mesh = this.meshes[meshType].reduce(
|
||||
function(result, object) {
|
||||
var mesh = null;
|
||||
|
||||
if (object.inUse === false) {
|
||||
object.inUse = true;
|
||||
result = object.mesh;
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
null
|
||||
);
|
||||
for (var i = 0; i < this.meshes[meshType].length; i++) {
|
||||
if (this.meshes[meshType][i].inUse === false) {
|
||||
this.meshes[meshType][i].inUse = true;
|
||||
|
||||
mesh = this.meshes[meshType][i].mesh;
|
||||
mesh.burnLife = 1;
|
||||
mesh.explodeLife = 1;
|
||||
mesh.instance.material.color.set(1,1,1);
|
||||
|
||||
return mesh;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.spawnEnemy = function(kanister) {
|
||||
|
||||
|
@ -703,18 +700,18 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
|||
game : this
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this.totalTime += data.delta;
|
||||
this.enemySpawnTime += data.delta;
|
||||
this.totalTime += data.delta;
|
||||
this.enemySpawnTime += data.delta;
|
||||
|
||||
this.scoreMesh.materials[0].opacity -= data.delta * 0.5;
|
||||
if (this.scoreMesh.materials[0].opacity < 0) {
|
||||
this.scoreMesh.materials[0].opacity -= data.delta * 0.5;
|
||||
if (this.scoreMesh.materials[0].opacity < 0) {
|
||||
this.scoreMesh.materials[0].opacity = 0;
|
||||
}
|
||||
this.scoreMesh.materials[0].updateInstance('opacity');
|
||||
}
|
||||
this.scoreMesh.materials[0].updateInstance('opacity');
|
||||
|
||||
/*
|
||||
/*
|
||||
this.scene.meshes.map(
|
||||
function(mesh) {
|
||||
if (mesh.instance.material instanceof Array) {
|
||||
|
@ -734,8 +731,8 @@ this.scoreMesh.materials[0].updateInstance('opacity');
|
|||
);
|
||||
*/
|
||||
|
||||
if (this.mouseIsDown)
|
||||
{
|
||||
if (this.mouseIsDown)
|
||||
{
|
||||
this.kanisterTime += data.delta;
|
||||
|
||||
this.renderer.clearColor.r += 0.01;
|
||||
|
@ -816,9 +813,9 @@ if (this.mouseIsDown)
|
|||
}.bind(this)
|
||||
);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
this.kanisterTime += (data.delta * this.kanisterLeakTime);
|
||||
|
||||
this.renderer.clearColor.r -= 0.01;
|
||||
|
@ -832,11 +829,11 @@ else
|
|||
this.throwerLight.intensity = 0;
|
||||
}
|
||||
this.throwerLight.updateInstance('intensity');
|
||||
}
|
||||
}
|
||||
|
||||
var used = this.kanisterTime / this.kanisterLife;
|
||||
var used = this.kanisterTime / this.kanisterLife;
|
||||
|
||||
GameLib.Event.Emit(
|
||||
GameLib.Event.Emit(
|
||||
GameLib.Event.GAME_DATA,
|
||||
{
|
||||
event : 'fuelUsed',
|
||||
|
@ -844,9 +841,9 @@ GameLib.Event.Emit(
|
|||
percentage : Math.round(used * 100) + '%',
|
||||
kanisters : this.kanisters
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
if (this.kanisterTime > this.kanisterLife) {
|
||||
if (this.kanisterTime > this.kanisterLife) {
|
||||
|
||||
this.kanisterTime = 0;
|
||||
this.kanisters -= 1;
|
||||
|
@ -867,14 +864,14 @@ if (this.kanisterTime > this.kanisterLife) {
|
|||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.enemySpawnTime > this.enemySpawnInterval && this.running) {
|
||||
if (this.enemySpawnTime > this.enemySpawnInterval && this.running) {
|
||||
this.enemySpawnTime = 0;
|
||||
this.spawnEnemy();
|
||||
}
|
||||
}
|
||||
|
||||
this.enemies = this.enemies.reduce(
|
||||
this.enemies = this.enemies.reduce(
|
||||
|
||||
function(result, enemy) {
|
||||
|
||||
|
@ -951,7 +948,7 @@ this.enemies = this.enemies.reduce(
|
|||
|
||||
}.bind(this),
|
||||
[]
|
||||
);
|
||||
);
|
||||
|
||||
return null;
|
||||
return null;
|
||||
//# sourceURL=beforeRender.js
|
||||
|
|
Loading…
Reference in New Issue