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

beta.r3js.org
-=yb4f310 2018-03-12 14:40:09 +01:00
parent d9ca25c773
commit b1e4118bbe
1 changed files with 26 additions and 1 deletions

View File

@ -33,10 +33,35 @@ this.scene = GameLib.EntityManager.Instance.findComponentById('pllp034hsj');
*/
this.snake = [];
GameLib.CustomCode.BODY_TYPE_HEAD = 0x1;
GameLib.CustomCode.BODY_TYPE_TAIL = 0x2;
GameLib.CustomCode.prototype.advanceSnake = function(delta) {
}.bind(this);
GameLib.CustomCode.prototype.cloneBody = function(bodyType) {
var body = null;
switch (bodyType) {
case (GameLib.CustomCode.BODY_TYPE_HEAD) :
body = this.meshEnd.clone();
break;
case (GameLib.CustomCode.BODY_TYPE_TAIL) :
body = this.meshEnd.clone();
body.rotation.z = Math.PI;
body.updateInstance('rotation');
break;
default:
console.warn('unhandled body type : ' + bodyType);
break;
}
return body;
}.bind(this);
GameLib.CustomCode.prototype.createMaterial = function(image) {
var diffuseMap = new GameLib.D3.Texture.Image(
this.runtime.graphics,
@ -70,7 +95,7 @@ GameLib.CustomCode.prototype.createGameMesh = function(image) {
/**
* Create our objects
*/
this.meshHead = this.createGameMesh(this.imageEnd);
this.meshEnd = this.createGameMesh(this.imageEnd);
this.meshPatty = this.createGameMesh(this.imagePatty);
this.meshBodyPatty = this.createGameMesh(this.imageBodyPatty);