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

beta.r3js.org
-=yb4f310 2018-03-23 08:40:51 +01:00
parent c39dc83dda
commit cc02305c6e
1 changed files with 170 additions and 168 deletions

View File

@ -531,7 +531,7 @@ GameLib.CustomCode.prototype.createGameObject = function(
if (currentGameObject.objectType === GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY) { if (currentGameObject.objectType === GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY) {
console.warn('should not reach this code if collision detection is perfect'); console.warn('should not reach this code if collision detection is perfect');
this.explode(currentGameObject.position); this.explode(currentGameObject.position);
return; return gameObject;
} }
this.grid[gameObject.position.x][gameObject.position.y].dispose(); this.grid[gameObject.position.x][gameObject.position.y].dispose();
@ -1008,6 +1008,10 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
} else { } else {
if (this.state.exploding === true) {
return;
}
temp = { temp = {
position : { position : {
x : body.position.x, x : body.position.x,
@ -1086,8 +1090,6 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
this.state.eating = false; this.state.eating = false;
this.visualizeGrid(); this.visualizeGrid();
}.bind(this); }.bind(this);