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

beta.r3js.org
-=yb4f310 2018-03-22 12:39:19 +01:00
parent 1f0b599d61
commit b02a42f6e2
1 changed files with 1038 additions and 987 deletions

View File

@ -47,9 +47,10 @@
GameLib.CustomCode.BODY_TYPE_BREAD_ONION = 2; GameLib.CustomCode.BODY_TYPE_BREAD_ONION = 2;
GameLib.CustomCode.BODY_TYPE_BREAD_ONION_RING = 3; GameLib.CustomCode.BODY_TYPE_BREAD_ONION_RING = 3;
GameLib.CustomCode.BODY_TYPE_BREAD_PATTY = 4; GameLib.CustomCode.BODY_TYPE_BREAD_PATTY = 4;
GameLib.CustomCode.BODY_TYPE_BREAD_HEAD = 5; GameLib.CustomCode.BODY_TYPE_BREAD_TOMATO = 5;
GameLib.CustomCode.BODY_TYPE_BREAD_TAIL = 6; GameLib.CustomCode.BODY_TYPE_BREAD_HEAD = 6;
GameLib.CustomCode.BODY_TYPE_BREAD_CORNER = 7; GameLib.CustomCode.BODY_TYPE_BREAD_TAIL = 7;
GameLib.CustomCode.BODY_TYPE_BREAD_CORNER = 8;
GameLib.CustomCode.OBJECT_TYPE_NONE = 0; GameLib.CustomCode.OBJECT_TYPE_NONE = 0;
GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY = 1; GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY = 1;
@ -89,6 +90,7 @@
this.materialBreadOnion = GameLib.EntityManager.Instance.findComponentById('69sybcj08d'); this.materialBreadOnion = GameLib.EntityManager.Instance.findComponentById('69sybcj08d');
this.materialBreadOnionRing = GameLib.EntityManager.Instance.findComponentById('kvesyjtr2v'); this.materialBreadOnionRing = GameLib.EntityManager.Instance.findComponentById('kvesyjtr2v');
this.materialBreadPatty = GameLib.EntityManager.Instance.findComponentById('k6axym9bu5'); this.materialBreadPatty = GameLib.EntityManager.Instance.findComponentById('k6axym9bu5');
this.materialBreadTomato = GameLib.EntityManager.Instance.findComponentById('9wxuzzz5co');
this.materialBreadHead = GameLib.EntityManager.Instance.findComponentById('heu4f7zzuh'); this.materialBreadHead = GameLib.EntityManager.Instance.findComponentById('heu4f7zzuh');
this.materialBreadTail = GameLib.EntityManager.Instance.findComponentById('mm2yq9rmpf'); this.materialBreadTail = GameLib.EntityManager.Instance.findComponentById('mm2yq9rmpf');
this.materialBreadCorner = GameLib.EntityManager.Instance.findComponentById('ju9r1bw6cb'); this.materialBreadCorner = GameLib.EntityManager.Instance.findComponentById('ju9r1bw6cb');
@ -434,6 +436,9 @@
case GameLib.CustomCode.BODY_TYPE_BREAD_PATTY : case GameLib.CustomCode.BODY_TYPE_BREAD_PATTY :
mesh = this.createGameMesh(this.materialBreadPatty); mesh = this.createGameMesh(this.materialBreadPatty);
break; break;
case GameLib.CustomCode.BODY_TYPE_BREAD_TOMATO :
mesh = this.createGameMesh(this.materialBreadTomato);
break;
case GameLib.CustomCode.BODY_TYPE_BREAD_HEAD : case GameLib.CustomCode.BODY_TYPE_BREAD_HEAD :
mesh = this.createGameMesh(this.materialBreadHead); mesh = this.createGameMesh(this.materialBreadHead);
break; break;
@ -785,6 +790,12 @@
} }
var body = null; var body = null;
GameLib.CustomCode.FOOD_BACON = 0;
GameLib.CustomCode.FOOD_CHEESE = 1;
GameLib.CustomCode.FOOD_ONION = 2;
GameLib.CustomCode.FOOD_ONION_RING = 3;
GameLib.CustomCode.FOOD_PATTY = 4;
GameLib.CustomCode.FOOD_TOMATO = 5;
switch (gameObject.type) { switch (gameObject.type) {
case GameLib.CustomCode.FOOD_BACON : case GameLib.CustomCode.FOOD_BACON :
@ -795,6 +806,46 @@
orientation orientation
) )
break; break;
case GameLib.CustomCode.FOOD_CHEESE :
body = this.createGameObject(
GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY,
GameLib.CustomCode.BODY_TYPE_BREAD_CHEESE,
position,
orientation
)
break;
case GameLib.CustomCode.FOOD_ONION :
body = this.createGameObject(
GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY,
GameLib.CustomCode.BODY_TYPE_BREAD_ONION,
position,
orientation
)
break;
case GameLib.CustomCode.FOOD_ONION_RING :
body = this.createGameObject(
GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY,
GameLib.CustomCode.BODY_TYPE_BREAD_ONION_RING,
position,
orientation
)
break;
case GameLib.CustomCode.FOOD_PATTY :
body = this.createGameObject(
GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY,
GameLib.CustomCode.BODY_TYPE_BREAD_PATTY,
position,
orientation
)
break;
case GameLib.CustomCode.FOOD_TOMATO :
body = this.createGameObject(
GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY,
GameLib.CustomCode.BODY_TYPE_BREAD_TOMATO,
position,
orientation
)
break;
default : default :
throw new Error('unhandled food type: ' + gameObject.type); throw new Error('unhandled food type: ' + gameObject.type);
} }
@ -863,7 +914,7 @@
this.explode(body.position); this.explode(body.position);
break; break;
case GameLib.CustomCode.OBJECT_TYPE_FOOD : case GameLib.CustomCode.OBJECT_TYPE_FOOD :
this.extend(gameObject); this.extend(gameObject, body.position, body.orientation);
break; break;
case GameLib.CustomCode.OBJECT_TYPE_POWERUP: case GameLib.CustomCode.OBJECT_TYPE_POWERUP:
this.powerup(gameObject); this.powerup(gameObject);