Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 319 bytes modified

beta.r3js.org
-=yb4f310 2018-03-12 14:24:45 +01:00
parent ce01fcefa2
commit 9812c5c5b2
1 changed files with 23 additions and 0 deletions

View File

@ -23,6 +23,15 @@ this.imagePatty = GameLib.EntityManager.Instance.findComponentById('4lf0fw24su'
*/
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) {
var diffuseMap = new GameLib.D3.Texture.Image(
this.runtime.graphics,
@ -63,6 +72,20 @@ this.meshBodyPatty = this.createGameMesh(this.imageBodyPatty);
GameLib.Event.Subscribe(
GameLib.Event.GAME_START,
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');
}
)