Update: CC - Before Render - Moorcow (a2ow5l92js.js) 494 bytes modified
parent
ce73f6db98
commit
8d8b6315cc
|
@ -38,6 +38,9 @@
|
||||||
this.santa.instance.visible = false;
|
this.santa.instance.visible = false;
|
||||||
|
|
||||||
this.treesBurning = 0;
|
this.treesBurning = 0;
|
||||||
|
this.treesBurningToStart = GameLib.Utils.GetRandomIntInclusive(1, 3)
|
||||||
|
|
||||||
|
this.running = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component is initializing - set the total time to 0
|
* This component is initializing - set the total time to 0
|
||||||
|
@ -162,7 +165,7 @@
|
||||||
} else if (meshType === 5) {
|
} else if (meshType === 5) {
|
||||||
mesh = this.santa.clone();
|
mesh = this.santa.clone();
|
||||||
material = this.santa.materials[0].clone();
|
material = this.santa.materials[0].clone();
|
||||||
speed = 0.5;
|
speed = 0.6;
|
||||||
} else {
|
} else {
|
||||||
console.log('unknown mesh type : ' + meshType);
|
console.log('unknown mesh type : ' + meshType);
|
||||||
}
|
}
|
||||||
|
@ -460,11 +463,26 @@
|
||||||
|
|
||||||
this.treesBurning++;
|
this.treesBurning++;
|
||||||
|
|
||||||
|
if (
|
||||||
|
(this.treesBurning > this.treesBurningToStart) &&
|
||||||
|
!this.running
|
||||||
|
) {
|
||||||
|
this.running = true;
|
||||||
|
GameLib.Event.Emit(
|
||||||
|
GameLib.Event.GAME_DATA,
|
||||||
|
{
|
||||||
|
event : 'gameRunning',
|
||||||
|
message : 'we have enough trees burning now to start - the enemy will spawn now'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
GameLib.Event.Emit(
|
GameLib.Event.Emit(
|
||||||
GameLib.Event.GAME_DATA,
|
GameLib.Event.GAME_DATA,
|
||||||
{
|
{
|
||||||
event : 'treeBurned',
|
event : 'treeBurned',
|
||||||
treesBurning : this.treesBurning
|
treesBurning : this.treesBurning,
|
||||||
|
treesBurningToStart : this.treesBurningToStart
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -666,7 +684,7 @@
|
||||||
this.throwerLight.updateInstance('intensity');
|
this.throwerLight.updateInstance('intensity');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.spawnTime > this.spawnInterval) {
|
if (this.spawnTime > this.spawnInterval && this.running) {
|
||||||
this.spawnTime = 0;
|
this.spawnTime = 0;
|
||||||
this.spawnEnemy();
|
this.spawnEnemy();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue