Update: CC - Before Render - Moorcow (a2ow5l92js.js) 6028 bytes modified
parent
8d8b6315cc
commit
e6db2003f9
|
@ -38,7 +38,7 @@
|
|||
this.santa.instance.visible = false;
|
||||
|
||||
this.treesBurning = 0;
|
||||
this.treesBurningToStart = GameLib.Utils.GetRandomIntInclusive(1, 3)
|
||||
this.treesBurningToStart = GameLib.Utils.GetRandomIntInclusive(1, 3);
|
||||
|
||||
this.running = false;
|
||||
|
||||
|
@ -46,15 +46,21 @@
|
|||
* This component is initializing - set the total time to 0
|
||||
*/
|
||||
this.totalTime = 0;
|
||||
this.spawnTime = 0;
|
||||
|
||||
this.kanisters = 4;
|
||||
this.kanisterTime = 0;
|
||||
this.kanisterLife = 16.344;
|
||||
this.kanisterLeakTime = 0.001;
|
||||
this.kanisterSpawnInterval = 50;
|
||||
|
||||
this.fuelFinished = false;
|
||||
|
||||
this.level = 1;
|
||||
this.spawnInterval = 5;
|
||||
|
||||
this.enemySpawnInterval = 5;
|
||||
this.enemySpawnTime = this.enemySpawnInterval;
|
||||
|
||||
this.score = 0;
|
||||
this.lives = 10;
|
||||
|
||||
if (this.enemies instanceof Array && this.enemies.length !== 0) {
|
||||
this.enemies.map(
|
||||
|
@ -73,7 +79,7 @@
|
|||
mesh.burningTreeParticleEngine = null;
|
||||
}
|
||||
}.bind(this)
|
||||
)
|
||||
);
|
||||
|
||||
this.enemies = [];
|
||||
|
||||
|
@ -86,13 +92,6 @@
|
|||
this.rightLight.intensity = 0.3;
|
||||
this.rightLight.updateInstance('intensity');
|
||||
|
||||
GameLib.Event.Emit(
|
||||
GameLib.Event.GAME_STARTED,
|
||||
{
|
||||
game : this
|
||||
}
|
||||
);
|
||||
|
||||
GameLib.Event.Emit(
|
||||
GameLib.Event.GET_GRAPHICS_IMPLEMENTATION,
|
||||
null,
|
||||
|
@ -115,26 +114,26 @@
|
|||
amount = 0.1;
|
||||
}
|
||||
|
||||
this.spawnInterval -= amount;
|
||||
this.enemySpawnInterval -= amount;
|
||||
|
||||
console.log('level : ' + this.level +', spawn interval : ' + this.spawnInterval);
|
||||
console.log('level : ' + this.level +', spawn interval : ' + this.enemySpawnInterval);
|
||||
|
||||
GameLib.Event.Emit(
|
||||
GameLib.Event.GAME_DATA,
|
||||
{
|
||||
level : this.level,
|
||||
spawnInterval : this.spawnInterval,
|
||||
enemySpawnInterval : this.enemySpawnInterval,
|
||||
event : 'levelIncrease'
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.spawnEnemy = function() {
|
||||
|
||||
this.enemiesSpawned++;
|
||||
|
||||
this.setLevelProperties();
|
||||
//this.setLevelProperties();
|
||||
|
||||
var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5);
|
||||
var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5);
|
||||
|
@ -269,7 +268,7 @@
|
|||
);
|
||||
|
||||
this.enemies.push(enemy);
|
||||
}
|
||||
};
|
||||
|
||||
this.explodeMesh = function(mesh) {
|
||||
|
||||
|
@ -359,13 +358,13 @@
|
|||
);
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
this.explodeKanister = function() {
|
||||
this.kanisterTime = 0;
|
||||
this.fuelFinished = false;
|
||||
this.explodeMesh(this.kanister);
|
||||
}
|
||||
};
|
||||
|
||||
this.burn = function(mesh) {
|
||||
|
||||
|
@ -408,7 +407,7 @@
|
|||
);
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
this.kill = function(enemy) {
|
||||
/**
|
||||
|
@ -528,13 +527,18 @@
|
|||
burningTreeParticleEngine.enabled = true;
|
||||
mesh.burningTreeParticleEngine = burningTreeParticleEngine;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.spawnEnemy();
|
||||
GameLib.Event.Emit(
|
||||
GameLib.Event.GAME_STARTED,
|
||||
{
|
||||
game : this
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
this.totalTime += data.delta;
|
||||
this.spawnTime += data.delta;
|
||||
this.enemySpawnTime += data.delta;
|
||||
|
||||
this.scene.meshes.map(
|
||||
function(mesh) {
|
||||
|
@ -567,7 +571,6 @@
|
|||
}
|
||||
);
|
||||
|
||||
|
||||
if (this.kanisterTime > this.kanisterLife) {
|
||||
this.fuelFinished = true;
|
||||
|
||||
|
@ -684,8 +687,8 @@
|
|||
this.throwerLight.updateInstance('intensity');
|
||||
}
|
||||
|
||||
if (this.spawnTime > this.spawnInterval && this.running) {
|
||||
this.spawnTime = 0;
|
||||
if (this.enemySpawnTime > this.enemySpawnInterval && this.running) {
|
||||
this.enemySpawnTime = 0;
|
||||
this.spawnEnemy();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue