Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 448 bytes modified
parent
55cd881574
commit
01c61703cf
|
@ -330,7 +330,7 @@ GameLib.CustomCode.prototype.waitReload = function(delta) {
|
||||||
|
|
||||||
GameLib.CustomCode.prototype.visualizeGrid = function () {
|
GameLib.CustomCode.prototype.visualizeGrid = function () {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (this.noneMesh) {
|
if (this.noneMesh) {
|
||||||
this.scene.instance.remove(this.noneMesh);
|
this.scene.instance.remove(this.noneMesh);
|
||||||
|
@ -1173,12 +1173,20 @@ 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)
|
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;
|
this.speed -= this.extendSpeedGrain;
|
||||||
|
|
||||||
if (this.speed < GameLib.CustomCode.MAX_SPEED) {
|
if (this.speed < GameLib.CustomCode.MAX_SPEED) {
|
||||||
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);
|
console.log('speed = ' + this.speed);
|
||||||
|
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
Loading…
Reference in New Issue