Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 583 bytes modified
parent
733e04ae0b
commit
813cdace37
|
@ -105,6 +105,9 @@ this.scene = GameLib.EntityManager.Instance.findComponentById('pllp034hsj');
|
|||
this.animation = GameLib.EntityManager.Instance.findComponentById('8kb7utb2fn');
|
||||
this.animationRotation = GameLib.EntityManager.Instance.findComponentById('z628kythyn');
|
||||
this.particleEnginePickle = GameLib.EntityManager.Instance.findComponentById('ddtkiu8aaa');
|
||||
this.particlePickle = GameLib.EntityManager.Instance.findComponentById('8lx1d9tnbf');
|
||||
|
||||
GameLib.CustomCode.EXPLODE_LIFETIME = this.particlePickle.lifeTime;
|
||||
|
||||
/**
|
||||
* Game objects
|
||||
|
@ -126,6 +129,8 @@ this.nextPowerupTime = GameLib.Utils.GetRandomIntInclusive(
|
|||
);
|
||||
this.powerups = [];
|
||||
|
||||
this.explodeTime = 0;
|
||||
|
||||
/**
|
||||
* Orientation is 0, 1, 2 or 3, (up, left, down, right) -
|
||||
* This is also the amount we need to multiply with PI to get the mesh rotation
|
||||
|
@ -140,6 +145,24 @@ this.state = {
|
|||
lives : 2
|
||||
};
|
||||
|
||||
GameLib.CustomCode.prototype.waitReload = function(delta) {
|
||||
|
||||
this.explodeTime += delta;
|
||||
|
||||
if (this.explodeTime < GameLib.CustomCode.EXPLODE_LIFETIME) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.particleEnginePickle.enabled = false;
|
||||
|
||||
/**
|
||||
* We need to revert to a good state
|
||||
*/
|
||||
|
||||
console.warn('revert to good state');
|
||||
|
||||
}.bind(this)
|
||||
|
||||
GameLib.CustomCode.prototype.visualizeGrid = function () {
|
||||
|
||||
if (this.noneMesh) {
|
||||
|
@ -768,7 +791,7 @@ GameLib.CustomCode.prototype.explode = function(position) {
|
|||
|
||||
this.particleEnginePickle.enabled = true;
|
||||
|
||||
}
|
||||
}.bind(this)
|
||||
|
||||
/**
|
||||
* Extend the snake with information from gameObject
|
||||
|
@ -1181,6 +1204,8 @@ GameLib.Event.Subscribe(
|
|||
);
|
||||
this.powerups = [];
|
||||
|
||||
this.explodeTime = 0;
|
||||
|
||||
/**
|
||||
* Re-initialize our other custom code components
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue