Update: CC - Before Render - Moorcow (a2ow5l92js.js) 494 bytes modified

beta.r3js.org
-=yb4f310 2017-11-24 12:59:37 +01:00
parent ce73f6db98
commit 8d8b6315cc
1 changed files with 21 additions and 3 deletions

View File

@ -38,7 +38,10 @@
this.santa.instance.visible = false;
this.treesBurning = 0;
this.treesBurningToStart = GameLib.Utils.GetRandomIntInclusive(1, 3)
this.running = false;
/**
* This component is initializing - set the total time to 0
*/
@ -162,7 +165,7 @@
} else if (meshType === 5) {
mesh = this.santa.clone();
material = this.santa.materials[0].clone();
speed = 0.5;
speed = 0.6;
} else {
console.log('unknown mesh type : ' + meshType);
}
@ -460,11 +463,26 @@
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.GAME_DATA,
{
event : 'treeBurned',
treesBurning : this.treesBurning
treesBurning : this.treesBurning,
treesBurningToStart : this.treesBurningToStart
}
);
@ -666,7 +684,7 @@
this.throwerLight.updateInstance('intensity');
}
if (this.spawnTime > this.spawnInterval) {
if (this.spawnTime > this.spawnInterval && this.running) {
this.spawnTime = 0;
this.spawnEnemy();
}