2018-03-14 11:54:53 +01:00
|
|
|
if (this.parentEntity === data.entity) {
|
|
|
|
console.log('snake entity loaded');
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines
|
|
|
|
*/
|
|
|
|
GameLib.CustomCode.BODY_TYPE_NORMAL = 0x1;
|
|
|
|
GameLib.CustomCode.BODY_TYPE_TAIL = 0x2;
|
2018-03-15 11:25:17 +01:00
|
|
|
GameLib.CustomCode.BODY_TYPE_CORNER = 0x3;
|
2018-03-14 11:54:53 +01:00
|
|
|
|
|
|
|
GameLib.CustomCode.GRID_WIDTH = 11;
|
|
|
|
GameLib.CustomCode.GRID_HEIGHT = 11;
|
|
|
|
|
|
|
|
GameLib.CustomCode.GRID_OFFSET_X = 1;
|
|
|
|
GameLib.CustomCode.GRID_OFFSET_Y = 5;
|
|
|
|
|
|
|
|
GameLib.CustomCode.SPEED_INITIAL = 1;
|
|
|
|
|
|
|
|
GameLib.CustomCode.ORIENTATION_UP = 0;
|
|
|
|
GameLib.CustomCode.ORIENTATION_LEFT = 1;
|
|
|
|
GameLib.CustomCode.ORIENTATION_DOWN = 2;
|
|
|
|
GameLib.CustomCode.ORIENTATION_RIGHT = 3;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get runtime
|
|
|
|
*/
|
|
|
|
this.runtime = GameLib.Utils.GetRuntime();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom Code Components
|
|
|
|
*/
|
|
|
|
this.beforeRender = GameLib.EntityManager.Instance.findComponentById('zjq6ach3jt');
|
|
|
|
this.keyUp = GameLib.EntityManager.Instance.findComponentById('306204wy29');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Geometries
|
|
|
|
*/
|
|
|
|
this.geometryBody = GameLib.EntityManager.Instance.findComponentById('8f5q7k5ozp');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Images
|
|
|
|
*/
|
|
|
|
this.imageBreadHead = GameLib.EntityManager.Instance.findComponentById('swkla3wpp');
|
|
|
|
this.imageBreadTail = GameLib.EntityManager.Instance.findComponentById('se6qlnmojd');
|
|
|
|
this.imageBreadPatty = GameLib.EntityManager.Instance.findComponentById('01r51k9ptr');
|
|
|
|
this.imageBreadCorner = GameLib.EntityManager.Instance.findComponentById('iljpuouaok');
|
|
|
|
this.imagePatty = GameLib.EntityManager.Instance.findComponentById('4lf0fw24su');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Other Objects (Scene)
|
|
|
|
*/
|
|
|
|
this.scene = GameLib.EntityManager.Instance.findComponentById('pllp034hsj');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Game objects
|
|
|
|
*/
|
|
|
|
this.snake = [];
|
|
|
|
this.grid = [];
|
|
|
|
this.speed = GameLib.CustomCode.SPEED_INITIAL;
|
|
|
|
this.advanceTime = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Orientation is 0, 1, 2 or 3, (up, left, down, right) -
|
|
|
|
* This is also the amount we need to multiply with PI to get the mesh rotation
|
|
|
|
* @type {{direction: {x: number, y: number}, orientation: number}}
|
|
|
|
*/
|
|
|
|
this.state = {
|
2018-03-15 11:36:32 +01:00
|
|
|
orientation : 0,
|
|
|
|
turning : false
|
2018-03-14 11:54:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
GameLib.CustomCode.prototype.createMaterial = function(image) {
|
|
|
|
var diffuseMap = new GameLib.D3.Texture.Image(
|
|
|
|
this.runtime.graphics,
|
|
|
|
{
|
|
|
|
image : image
|
|
|
|
}
|
|
|
|
)
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
return new GameLib.D3.Material.Phong(
|
|
|
|
this.runtime.graphics,
|
|
|
|
{
|
|
|
|
diffuseMap : diffuseMap
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}.bind(this);
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
GameLib.CustomCode.prototype.createGameMesh = function(image) {
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
var mesh = new GameLib.D3.Mesh(
|
|
|
|
this.runtime.graphics,
|
|
|
|
{
|
|
|
|
geometry : this.geometryBody,
|
|
|
|
materials : [this.createMaterial(image)]
|
|
|
|
}
|
|
|
|
)
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
this.scene.addClone(mesh);
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
return mesh;
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
}.bind(this)
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
/**
|
|
|
|
* Create our objects
|
|
|
|
*/
|
|
|
|
this.meshBreadHead = this.createGameMesh(this.imageBreadHead);
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
this.meshBreadTail = this.createGameMesh(this.imageBreadTail);
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
this.meshBreadPatty = this.createGameMesh(this.imageBreadPatty);
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
this.meshBreadCorner = this.createGameMesh(this.imageBreadCorner);
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
this.meshPatty = this.createGameMesh(this.imagePatty);
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
/**
|
|
|
|
* GameLib.CustomCode.SnakeBody
|
|
|
|
* @param mesh
|
|
|
|
* @param position
|
|
|
|
* @param orientation
|
2018-03-15 11:36:32 +01:00
|
|
|
* @param bodyType
|
2018-03-15 12:46:00 +01:00
|
|
|
* @param backup
|
2018-03-14 11:54:53 +01:00
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
GameLib.CustomCode.SnakeBody = function(
|
|
|
|
mesh,
|
|
|
|
position,
|
2018-03-15 11:25:17 +01:00
|
|
|
orientation,
|
2018-03-15 12:46:00 +01:00
|
|
|
bodyType,
|
|
|
|
backup
|
2018-03-14 11:54:53 +01:00
|
|
|
) {
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
if (GameLib.Utils.UndefinedOrNull(mesh)) {
|
|
|
|
throw new Error('no mesh specified');
|
|
|
|
}
|
|
|
|
this.mesh = mesh.clone();
|
2018-03-15 12:46:00 +01:00
|
|
|
this.mesh.useQuaternion = false;
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
if (GameLib.Utils.UndefinedOrNull(position)) {
|
|
|
|
position = {
|
|
|
|
x : Math.round(GameLib.CustomCode.GRID_WIDTH / 2),
|
|
|
|
y : Math.round(GameLib.CustomCode.GRID_HEIGHT / 2)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
this.position = position;
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
if (GameLib.Utils.UndefinedOrNull(orientation)) {
|
|
|
|
orientation = GameLib.CustomCode.ORIENTATION_UP;
|
|
|
|
}
|
|
|
|
this.orientation = orientation;
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-15 11:36:32 +01:00
|
|
|
if (GameLib.Utils.UndefinedOrNull(bodyType)) {
|
2018-03-15 11:25:17 +01:00
|
|
|
bodyType = GameLib.CustomCode.BODY_TYPE_NORMAL;
|
|
|
|
}
|
2018-03-15 11:36:32 +01:00
|
|
|
this.bodyType = bodyType;
|
2018-03-15 11:25:17 +01:00
|
|
|
|
2018-03-15 12:46:00 +01:00
|
|
|
if (GameLib.Utils.UndefinedOrNull(backup)) {
|
|
|
|
backup = null;
|
|
|
|
}
|
|
|
|
this.backup = backup;
|
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
this.applyToMesh();
|
|
|
|
};
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-15 12:46:00 +01:00
|
|
|
GameLib.CustomCode.SnakeBody.prototype.restoreBackup = function() {
|
|
|
|
|
|
|
|
if (!this.backup) {
|
|
|
|
console.warn('no backup to restore');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.mesh.geometry = null;
|
|
|
|
this.mesh.materials = null;
|
|
|
|
this.mesh.remove();
|
|
|
|
|
|
|
|
this.mesh = this.backup.mesh;
|
|
|
|
this.mesh.visible = true;
|
|
|
|
this.mesh.updateInstance('visible');
|
|
|
|
|
|
|
|
this.orientation = this.backup.orientation;
|
|
|
|
this.bodyType = this.backup.bodyType;
|
|
|
|
|
|
|
|
this.backup = null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* We don't restore the position because the position will have changed
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
GameLib.CustomCode.SnakeBody.prototype.applyToMesh = function() {
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
this.mesh.position.x = this.position.x + GameLib.CustomCode.GRID_OFFSET_X;
|
|
|
|
this.mesh.position.y = this.position.y + GameLib.CustomCode.GRID_OFFSET_Y;
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:59:18 +01:00
|
|
|
this.mesh.rotation.z = this.orientation * Math.PI / 2;
|
2018-03-14 11:53:15 +01:00
|
|
|
|
|
|
|
/**
|
2018-03-14 11:54:53 +01:00
|
|
|
* TODO: We don't update instance position - animation should do this
|
2018-03-14 11:53:15 +01:00
|
|
|
*/
|
2018-03-14 11:54:53 +01:00
|
|
|
this.mesh.updateInstance('position');
|
|
|
|
this.mesh.updateInstance('rotation');
|
|
|
|
}
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
GameLib.CustomCode.SnakeBody.prototype.advance = function(orientation) {
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
if (orientation === GameLib.CustomCode.ORIENTATION_UP) {
|
|
|
|
this.position.y += 1;
|
|
|
|
}
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
if (orientation === GameLib.CustomCode.ORIENTATION_DOWN) {
|
|
|
|
this.position.y -= 1;
|
|
|
|
}
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
if (orientation === GameLib.CustomCode.ORIENTATION_LEFT) {
|
|
|
|
this.position.x -= 1;
|
|
|
|
}
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
if (orientation === GameLib.CustomCode.ORIENTATION_RIGHT) {
|
|
|
|
this.position.x += 1;
|
|
|
|
}
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
this.orientation = orientation;
|
|
|
|
}
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-15 13:16:43 +01:00
|
|
|
|
2018-03-15 13:12:13 +01:00
|
|
|
this.advanceTime += delta;
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-15 13:12:13 +01:00
|
|
|
if (this.advanceTime > this.speed) {
|
|
|
|
this.advanceTime = 0;
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-15 15:12:26 +01:00
|
|
|
var backup = null;
|
|
|
|
var temp = null;
|
|
|
|
|
2018-03-15 15:01:32 +01:00
|
|
|
this.snake.map(
|
|
|
|
function(body, index) {
|
2018-03-15 12:46:00 +01:00
|
|
|
|
2018-03-15 15:01:32 +01:00
|
|
|
if (index === 0) {
|
2018-03-15 15:12:26 +01:00
|
|
|
|
2018-03-15 15:24:56 +01:00
|
|
|
backup = {
|
2018-03-15 15:12:26 +01:00
|
|
|
position : {
|
|
|
|
x : body.position.x,
|
|
|
|
y : body.position.y
|
|
|
|
},
|
|
|
|
orientation : body.orientation
|
|
|
|
}
|
2018-03-15 15:24:56 +01:00
|
|
|
|
|
|
|
body.advance(
|
|
|
|
this.state.orientation
|
|
|
|
);
|
2018-03-15 15:33:53 +01:00
|
|
|
|
|
|
|
backup.orientation = body.orientation;
|
2018-03-15 15:01:32 +01:00
|
|
|
}
|
2018-03-15 12:46:00 +01:00
|
|
|
|
2018-03-15 15:12:26 +01:00
|
|
|
if (index > 0) {
|
2018-03-15 12:46:00 +01:00
|
|
|
|
2018-03-15 15:12:26 +01:00
|
|
|
temp = {
|
|
|
|
position : {
|
|
|
|
x : body.position.x,
|
|
|
|
y : body.position.y
|
|
|
|
},
|
|
|
|
orientation : body.orientation
|
|
|
|
}
|
2018-03-15 15:17:44 +01:00
|
|
|
|
2018-03-15 15:12:26 +01:00
|
|
|
body.position.x = backup.position.x;
|
|
|
|
body.position.y = backup.position.y;
|
|
|
|
body.orientation = backup.orientation;
|
|
|
|
|
2018-03-15 15:17:44 +01:00
|
|
|
if (body.backupMesh) {
|
|
|
|
/**
|
|
|
|
* We used to be a corner, change back
|
|
|
|
* @type {null}
|
|
|
|
*/
|
|
|
|
body.mesh.geometry = null;
|
|
|
|
|
|
|
|
body.mesh.materials = null;
|
|
|
|
|
|
|
|
body.mesh.remove();
|
|
|
|
|
|
|
|
body.mesh = body.backupMesh;
|
2018-03-15 15:24:56 +01:00
|
|
|
|
|
|
|
body.backupMesh = null;
|
2018-03-15 15:17:44 +01:00
|
|
|
|
|
|
|
body.mesh.visible = true;
|
|
|
|
|
|
|
|
body.mesh.updateInstance('visible');
|
|
|
|
}
|
|
|
|
|
2018-03-15 15:32:34 +01:00
|
|
|
if (
|
2018-03-15 15:33:53 +01:00
|
|
|
body.orientation !== backup.orientation &&
|
2018-03-15 15:32:34 +01:00
|
|
|
(index + 1) < this.snake.length
|
|
|
|
) {
|
2018-03-15 15:17:44 +01:00
|
|
|
/**
|
|
|
|
* Our orientation changed - we should make a corner
|
|
|
|
*/
|
|
|
|
body.backupMesh = body.mesh;
|
|
|
|
|
|
|
|
body.backupMesh.visible = false;
|
|
|
|
|
|
|
|
body.backupMesh.updateInstance('visible');
|
|
|
|
|
|
|
|
body.mesh = this.meshBreadCorner.clone();
|
|
|
|
}
|
|
|
|
|
2018-03-15 15:12:26 +01:00
|
|
|
backup = temp;
|
2018-03-15 12:46:00 +01:00
|
|
|
}
|
2018-03-15 15:17:44 +01:00
|
|
|
|
2018-03-15 15:01:32 +01:00
|
|
|
body.applyToMesh();
|
2018-03-15 15:12:26 +01:00
|
|
|
|
2018-03-15 15:01:32 +01:00
|
|
|
}.bind(this)
|
|
|
|
)
|
2018-03-15 15:12:26 +01:00
|
|
|
|
2018-03-15 15:17:44 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
}.bind(this);
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
/*
|
|
|
|
GameLib.CustomCode.prototype.initializeGrid = function() {
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
this.grid = [];
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
for (var x = 0; x < GameLib.CustomCode.GRID_WIDTH; x++) {
|
|
|
|
this.grid[x] = [];
|
|
|
|
for (var y = 0; y < GameLib.CustomCode.GRID_HEIGHT; y++) {
|
|
|
|
this.grid[x][y] = {
|
|
|
|
mesh : null,
|
|
|
|
direction : {
|
|
|
|
x : 0,
|
|
|
|
y : 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
}.bind(this);
|
|
|
|
*/
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
GameLib.Event.Subscribe(
|
|
|
|
GameLib.Event.GAME_START,
|
|
|
|
function() {
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
/**
|
|
|
|
* Remove all existing snake parts
|
|
|
|
*/
|
|
|
|
this.snake.map(
|
|
|
|
function(body) {
|
|
|
|
body.geometry = null;
|
|
|
|
body.materials = null;
|
|
|
|
body.remove();
|
|
|
|
}
|
|
|
|
)
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
this.state = {
|
|
|
|
orientation : GameLib.CustomCode.ORIENTATION_UP
|
|
|
|
};
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
this.snake = [
|
|
|
|
new GameLib.CustomCode.SnakeBody(
|
|
|
|
this.meshBreadHead,
|
|
|
|
{
|
|
|
|
x : 4,
|
|
|
|
y : 4
|
|
|
|
},
|
|
|
|
0
|
|
|
|
),
|
|
|
|
new GameLib.CustomCode.SnakeBody(
|
|
|
|
this.meshBreadPatty,
|
|
|
|
{
|
|
|
|
x : 4,
|
|
|
|
y : 3
|
|
|
|
},
|
|
|
|
0
|
|
|
|
),
|
|
|
|
new GameLib.CustomCode.SnakeBody(
|
|
|
|
this.meshBreadPatty,
|
|
|
|
{
|
|
|
|
x : 4,
|
|
|
|
y : 2
|
|
|
|
},
|
|
|
|
0
|
|
|
|
),
|
|
|
|
new GameLib.CustomCode.SnakeBody(
|
|
|
|
this.meshBreadTail,
|
|
|
|
{
|
|
|
|
x : 4,
|
|
|
|
y : 1
|
|
|
|
},
|
2018-03-15 11:36:32 +01:00
|
|
|
0,
|
|
|
|
GameLib.CustomCode.BODY_TYPE_TAIL
|
2018-03-14 11:54:53 +01:00
|
|
|
)
|
|
|
|
];
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
/**
|
|
|
|
* Cleanup grid
|
|
|
|
*
|
|
|
|
this.grid.map(
|
|
|
|
function(x) {
|
2018-03-15 12:46:00 +01:00
|
|
|
x.map(
|
|
|
|
function(y) {
|
|
|
|
y.mesh.geometry = null;
|
|
|
|
y.mesh.materials = null;
|
|
|
|
y.mesh.remove();
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
2018-03-14 11:54:53 +01:00
|
|
|
);
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
this.initializeGrid();
|
|
|
|
*/
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
/**
|
|
|
|
* Other Settings
|
|
|
|
*/
|
|
|
|
this.speed = GameLib.CustomCode.SPEED_INITIAL;
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
/**
|
|
|
|
* Re-initialize our other custom code components
|
|
|
|
*/
|
|
|
|
this.beforeRender.initialized = false;
|
|
|
|
this.beforeRender.entityLoaded = this;
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
this.keyUp.initialized = false;
|
|
|
|
this.keyUp.entityLoaded = this;
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
console.log('starting game snake');
|
|
|
|
}.bind(this)
|
|
|
|
);
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
GameLib.Event.Subscribe(
|
|
|
|
GameLib.Event.GAME_OVER,
|
|
|
|
function() {
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
this.keyUp.initialized = false;
|
|
|
|
this.keyUp.entityLoaded = null;
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
this.beforeRender.initialized = false;
|
|
|
|
this.beforeRender.entityLoaded = null;
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
console.log('starting game snake');
|
|
|
|
}.bind(this)
|
|
|
|
)
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
GameLib.Event.Emit(GameLib.Event.GAME_LOADED);
|
2018-03-14 11:53:15 +01:00
|
|
|
|
2018-03-14 11:54:53 +01:00
|
|
|
//@ sourceURL=entityLoaded.js
|