Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 65 bytes modified
parent
40311bb233
commit
0b72479c81
|
@ -833,7 +833,9 @@ GameLib.CustomCode.SnakeBody.prototype = Object.create(GameLib.CustomCode.GameOb
|
||||||
GameLib.CustomCode.SnakeBody.prototype.constructor = GameLib.CustomCode.GameObject;
|
GameLib.CustomCode.SnakeBody.prototype.constructor = GameLib.CustomCode.GameObject;
|
||||||
|
|
||||||
GameLib.CustomCode.SnakeBody.prototype.dispose = function() {
|
GameLib.CustomCode.SnakeBody.prototype.dispose = function() {
|
||||||
|
|
||||||
GameLib.CustomCode.GameObject.prototype.dispose.call(this);
|
GameLib.CustomCode.GameObject.prototype.dispose.call(this);
|
||||||
|
|
||||||
if (this.backupMesh) {
|
if (this.backupMesh) {
|
||||||
this.backupMesh.geometry = null;
|
this.backupMesh.geometry = null;
|
||||||
this.backupMesh.materials = null;
|
this.backupMesh.materials = null;
|
||||||
|
@ -1152,7 +1154,7 @@ GameLib.CustomCode.prototype.createCorner = function(body, temp) {
|
||||||
|
|
||||||
GameLib.CustomCode.prototype.backup = function() {
|
GameLib.CustomCode.prototype.backup = function() {
|
||||||
|
|
||||||
this.backup = {
|
this.backupState = {
|
||||||
snake : this.snake.map(
|
snake : this.snake.map(
|
||||||
function(body) {
|
function(body) {
|
||||||
return body.clone();
|
return body.clone();
|
||||||
|
@ -1178,7 +1180,7 @@ GameLib.CustomCode.prototype.restore = function() {
|
||||||
var meshFound = false;
|
var meshFound = false;
|
||||||
var backupMeshFound = false;
|
var backupMeshFound = false;
|
||||||
|
|
||||||
this.backup.snake.map(
|
this.backupState.snake.map(
|
||||||
function (backupBody) {
|
function (backupBody) {
|
||||||
if (
|
if (
|
||||||
body.mesh === backupBody.mesh ||
|
body.mesh === backupBody.mesh ||
|
||||||
|
@ -1222,9 +1224,9 @@ GameLib.CustomCode.prototype.restore = function() {
|
||||||
/**
|
/**
|
||||||
* Restore our backup
|
* Restore our backup
|
||||||
*/
|
*/
|
||||||
this.state.orientation = this.backup.orientation;
|
this.state.orientation = this.backupState.orientation;
|
||||||
this.state.flip = this.backup.flip;
|
this.state.flip = this.backupState.flip;
|
||||||
this.snake = this.backup.snake.map(
|
this.snake = this.backupState.snake.map(
|
||||||
function(body) {
|
function(body) {
|
||||||
|
|
||||||
var clone = body.clone();
|
var clone = body.clone();
|
||||||
|
|
Loading…
Reference in New Issue