Update: CC - Before Render - Moorcow (080g209iov.js) 338 bytes modified
parent
a156579268
commit
703d529d06
|
@ -46,8 +46,14 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||||
this.kanisterLife = 16.344;
|
this.kanisterLife = 16.344;
|
||||||
this.fuelFinished = false;
|
this.fuelFinished = false;
|
||||||
|
|
||||||
|
this.level = 1;
|
||||||
|
this.spawnInterval = 5;
|
||||||
|
this.score = 0;
|
||||||
|
|
||||||
this.enemies = [];
|
this.enemies = [];
|
||||||
|
|
||||||
|
this.enemiesSpawned = 0;
|
||||||
|
|
||||||
GameLib.Event.Emit(
|
GameLib.Event.Emit(
|
||||||
GameLib.Event.GET_GRAPHICS_IMPLEMENTATION,
|
GameLib.Event.GET_GRAPHICS_IMPLEMENTATION,
|
||||||
null,
|
null,
|
||||||
|
@ -56,17 +62,26 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
this.getNextSpawnTime = function() {
|
//this.getNextSpawnTime = function() {
|
||||||
return GameLib.Utils.GetRandomIntInclusive(
|
/*return GameLib.Utils.GetRandomIntInclusive(
|
||||||
1,
|
1,
|
||||||
1
|
1
|
||||||
);
|
);*/
|
||||||
}
|
//}
|
||||||
|
|
||||||
this.nextSpawnTime = this.getNextSpawnTime();
|
//this.nextSpawnTime = this.getNextSpawnTime();
|
||||||
|
|
||||||
|
this.setLevelProperties = function() {
|
||||||
|
this.level = Math.floor(this.enemiesSpawned / 10) + 1;
|
||||||
|
this.spawnInterval -= 1 / (this.level);
|
||||||
|
}
|
||||||
|
|
||||||
this.spawnEnemy = function() {
|
this.spawnEnemy = function() {
|
||||||
|
|
||||||
|
this.enemiesSpawned++;
|
||||||
|
|
||||||
|
this.setLevelProperties();
|
||||||
|
|
||||||
var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5);
|
var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5);
|
||||||
var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5);
|
var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5);
|
||||||
|
|
||||||
|
@ -247,6 +262,9 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||||
function(enemy) {
|
function(enemy) {
|
||||||
if (enemy.mesh === mesh && !enemy.exploding) {
|
if (enemy.mesh === mesh && !enemy.exploding) {
|
||||||
console.log('exploding enemy');
|
console.log('exploding enemy');
|
||||||
|
|
||||||
|
this.score += this.level * 100;
|
||||||
|
|
||||||
enemy.exploding = true;
|
enemy.exploding = true;
|
||||||
|
|
||||||
this.explodeMesh(mesh);
|
this.explodeMesh(mesh);
|
||||||
|
@ -268,6 +286,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||||
this.enemies.map(
|
this.enemies.map(
|
||||||
function(enemy) {
|
function(enemy) {
|
||||||
if (enemy.mesh === mesh && !enemy.burning) {
|
if (enemy.mesh === mesh && !enemy.burning) {
|
||||||
|
this.score += this.level * 10;
|
||||||
console.log('burning enemy ' + mesh.name);
|
console.log('burning enemy ' + mesh.name);
|
||||||
enemy.burning = true;
|
enemy.burning = true;
|
||||||
var smokeParticleEngine = this.smokeParticleEngine.clone();
|
var smokeParticleEngine = this.smokeParticleEngine.clone();
|
||||||
|
@ -542,8 +561,7 @@ if (this.mouseIsDown) {
|
||||||
this.throwerLight.updateInstance('instensity');
|
this.throwerLight.updateInstance('instensity');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.spawnTime > this.nextSpawnTime) {
|
if (this.spawnTime > this.spawnInterval) {
|
||||||
this.nextSpawnTime = this.getNextSpawnTime();
|
|
||||||
this.spawnTime = 0;
|
this.spawnTime = 0;
|
||||||
this.spawnEnemy();
|
this.spawnEnemy();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue