Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 541 bytes modified
parent
d9ca25c773
commit
b1e4118bbe
|
@ -33,10 +33,35 @@ this.scene = GameLib.EntityManager.Instance.findComponentById('pllp034hsj');
|
||||||
*/
|
*/
|
||||||
this.snake = [];
|
this.snake = [];
|
||||||
|
|
||||||
|
GameLib.CustomCode.BODY_TYPE_HEAD = 0x1;
|
||||||
|
GameLib.CustomCode.BODY_TYPE_TAIL = 0x2;
|
||||||
|
|
||||||
GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
|
|
||||||
}.bind(this);
|
}.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) {
|
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,
|
||||||
|
@ -70,7 +95,7 @@ GameLib.CustomCode.prototype.createGameMesh = function(image) {
|
||||||
/**
|
/**
|
||||||
* Create our objects
|
* Create our objects
|
||||||
*/
|
*/
|
||||||
this.meshHead = this.createGameMesh(this.imageEnd);
|
this.meshEnd = this.createGameMesh(this.imageEnd);
|
||||||
this.meshPatty = this.createGameMesh(this.imagePatty);
|
this.meshPatty = this.createGameMesh(this.imagePatty);
|
||||||
this.meshBodyPatty = this.createGameMesh(this.imageBodyPatty);
|
this.meshBodyPatty = this.createGameMesh(this.imageBodyPatty);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue