From 01c61703cfe2d2a194837b52e8e528e7a1452127 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Sat, 24 Mar 2018 15:37:26 +0100 Subject: [PATCH] Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 448 bytes modified --- 21g30t1e75.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/21g30t1e75.js b/21g30t1e75.js index bbd07db..1664475 100644 --- a/21g30t1e75.js +++ b/21g30t1e75.js @@ -330,8 +330,8 @@ GameLib.CustomCode.prototype.waitReload = function(delta) { GameLib.CustomCode.prototype.visualizeGrid = function () { - return; - + return; + if (this.noneMesh) { this.scene.instance.remove(this.noneMesh); } @@ -1173,11 +1173,19 @@ GameLib.CustomCode.prototype.extend = function(gameObject, position, orientation this.extendSpeedGrain = (GameLib.CustomCode.SPEED_INITIAL - GameLib.CustomCode.MAX_SPEED) / ((GameLib.CustomCode.GRID_WIDTH * GameLib.CustomCode.GRID_HEIGHT) - this.snake.length) + var animationSpeedGrain = (GameLib.CustomCode.MAX_ANIMATION_SPEED - GameLib.CustomCode.MIN_ANIMATION_SPEED) / ((GameLib.CustomCode.GRID_WIDTH * GameLib.CustomCode.GRID_HEIGHT) - this.snake.length) + this.speed -= this.extendSpeedGrain; if (this.speed < GameLib.CustomCode.MAX_SPEED) { this.speed = GameLib.CustomCode.MAX_SPEED; } + + this.animation.translationSpeed += animationSpeedGrain; + + if (this.animation.translationSpeed > GameLib.CustomCode.MAX_ANIMATION_SPEED) { + this.animation.translationSpeed = GameLib.CustomCode.MAX_ANIMATION_SPEED; + } console.log('speed = ' + this.speed); @@ -1685,7 +1693,7 @@ GameLib.Event.Subscribe( message : null, gameOver : false }; - + this.initializeGrid(); this.visualizeGrid(); this.displayHUD();