From 4045c121bcb377dcab8668f982df24cf1d73c6ed Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Thu, 22 Mar 2018 11:46:44 +0100 Subject: [PATCH] Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 76 bytes modified --- 21g30t1e75.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/21g30t1e75.js b/21g30t1e75.js index 9eef6ae..4534e74 100644 --- a/21g30t1e75.js +++ b/21g30t1e75.js @@ -526,12 +526,12 @@ GameLib.CustomCode.SnakeBody = function( GameLib.CustomCode.GameObject.call( this, - GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY, + GameLib.Object.OBJECT_TYPE_SNAKE_BODY, type, mesh, position ); - + if (GameLib.Utils.UndefinedOrNull(orientation)) { orientation = GameLib.CustomCode.ORIENTATION_UP; } @@ -555,7 +555,7 @@ GameLib.CustomCode.SnakeBody = function( this.applyToMesh(); var animation = GameLib.EntityManager.Instance.findComponentById('8kb7utb2fn'); - + animation.meshes.push(this.mesh); }; @@ -946,7 +946,8 @@ GameLib.Event.Subscribe( }; this.snake = [ - new GameLib.CustomCode.SnakeBody( + this.createGameObject( + GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY, GameLib.CustomCode.BODY_TYPE_BREAD_HEAD, { x : 4, @@ -954,8 +955,9 @@ GameLib.Event.Subscribe( }, GameLib.CustomCode.ORIENTATION_UP ), - new GameLib.CustomCode.SnakeBody( - GameLib.CustomCode.BODY_TYPE_BREAD_TAIL, + this.createGameObject( + GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY, + GameLib.CustomCode.BODY_TYPE_BREAD_HEAD, { x : 4, y : 3 @@ -963,7 +965,7 @@ GameLib.Event.Subscribe( GameLib.CustomCode.ORIENTATION_UP ) ]; - + this.initializeGrid(); //this.visualizeGrid();