Update: CC - SnailRunner - Entity Loaded (78gnds8jrj.js) 565 bytes modified
parent
ec7827892b
commit
51dcb7c6b8
|
@ -25,15 +25,27 @@ this.treesRight = GameLib.EntityManager.Instance.findComponentById('oag0yr1rav')
|
||||||
this.road = GameLib.EntityManager.Instance.findComponentById('4furha3wst');
|
this.road = GameLib.EntityManager.Instance.findComponentById('4furha3wst');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Road Sections
|
* Road Sections and Clouds
|
||||||
*/
|
*/
|
||||||
this.sections = [];
|
this.sections = [];
|
||||||
|
this.clouds = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Camera
|
* Camera
|
||||||
*/
|
*/
|
||||||
this.camera = GameLib.EntityManager.Instance.findComponentById('hd8dsn7o4c');
|
this.camera = GameLib.EntityManager.Instance.findComponentById('hd8dsn7o4c');
|
||||||
|
|
||||||
|
GameLib.CustomCode.prototype.spawnCloud = function() {
|
||||||
|
var cloud = this.cloud.clone();
|
||||||
|
|
||||||
|
this.cloud.position.x = -155;
|
||||||
|
this.cloud.position.z = (Math.random() * 25) - 12.5;
|
||||||
|
this.cloud.updateInstance('position');
|
||||||
|
|
||||||
|
this.clouds.push(cloud);
|
||||||
|
}.bind(this)
|
||||||
|
|
||||||
|
GameLib.CustomCode.prototype.spawnRoadSections = function() {
|
||||||
|
|
||||||
var cloneLeft = this.treesLeft.clone();
|
var cloneLeft = this.treesLeft.clone();
|
||||||
var cloneRoad = this.road.clone();
|
var cloneRoad = this.road.clone();
|
||||||
|
@ -58,6 +70,8 @@ this.sections.push({
|
||||||
right : cloneRight
|
right : cloneRight
|
||||||
})
|
})
|
||||||
|
|
||||||
|
}.bind(this)
|
||||||
|
|
||||||
GameLib.Event.Subscribe(
|
GameLib.Event.Subscribe(
|
||||||
GameLib.Event.GAME_START,
|
GameLib.Event.GAME_START,
|
||||||
function() {
|
function() {
|
||||||
|
@ -68,6 +82,16 @@ GameLib.Event.Subscribe(
|
||||||
this.speed = 0;
|
this.speed = 0;
|
||||||
this.speedUp = false;
|
this.speedUp = false;
|
||||||
|
|
||||||
|
this.clouds.map(
|
||||||
|
function(cloud) {
|
||||||
|
cloud.geometry = null;
|
||||||
|
cloud.materials = null;
|
||||||
|
cloud.remove();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
this.clouds = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activate our custom code components
|
* Activate our custom code components
|
||||||
*/
|
*/
|
||||||
|
@ -81,6 +105,6 @@ GameLib.Event.Subscribe(
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this.spawnRoadSections();
|
||||||
|
|
||||||
//@ sourceURL=entityLoaded.js
|
//@ sourceURL=entityLoaded.js
|
Loading…
Reference in New Issue