Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 319 bytes modified
parent
ce01fcefa2
commit
9812c5c5b2
|
@ -23,6 +23,15 @@ this.imagePatty = GameLib.EntityManager.Instance.findComponentById('4lf0fw24su'
|
||||||
*/
|
*/
|
||||||
this.scene = GameLib.EntityManager.Instance.findComponentById('pllp034hsj');
|
this.scene = GameLib.EntityManager.Instance.findComponentById('pllp034hsj');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Game objects
|
||||||
|
*/
|
||||||
|
this.snake = [];
|
||||||
|
|
||||||
|
GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
|
|
||||||
|
}.bind(this);
|
||||||
|
|
||||||
GameLib.CustomCode.prototype.createMaterial = function(image) {
|
GameLib.CustomCode.prototype.createMaterial = function(image) {
|
||||||
var diffuseMap = new GameLib.D3.Texture.Image(
|
var diffuseMap = new GameLib.D3.Texture.Image(
|
||||||
this.runtime.graphics,
|
this.runtime.graphics,
|
||||||
|
@ -63,6 +72,20 @@ this.meshBodyPatty = this.createGameMesh(this.imageBodyPatty);
|
||||||
GameLib.Event.Subscribe(
|
GameLib.Event.Subscribe(
|
||||||
GameLib.Event.GAME_START,
|
GameLib.Event.GAME_START,
|
||||||
function() {
|
function() {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove all existing snake parts
|
||||||
|
*/
|
||||||
|
this.snake.map(
|
||||||
|
function(body) {
|
||||||
|
body.geometry = null;
|
||||||
|
body.materials = null;
|
||||||
|
body.remove();
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
this.snake = [];
|
||||||
|
|
||||||
console.log('starting game snake');
|
console.log('starting game snake');
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue