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

beta.r3js.org
-=yb4f310 2018-03-24 15:48:47 +01:00
parent e5e8ec9c54
commit a7939f8e07
1 changed files with 28 additions and 28 deletions

View File

@ -181,27 +181,27 @@ this.state = {
GameLib.CustomCode.prototype.advanceSpeedTimer = function(delta) {
this.speedTimer += delta;
this.speedTimer += delta;
if (this.speedTimer < GameLib.CustomCode.SPEED_INCREASE_INTERVAL) {
return;
}
if (this.speedTimer < GameLib.CustomCode.SPEED_INCREASE_INTERVAL) {
return;
}
this.speedTimer = 0;
this.speedTimer = 0;
this.speed -= GameLib.CustomCode.SPEED_GRAIN;
this.speed -= GameLib.CustomCode.SPEED_GRAIN;
if (this.speed < GameLib.CustomCode.MAX_SPEED) {
this.speed = GameLib.CustomCode.MAX_SPEED;
}
if (this.speed < GameLib.CustomCode.MAX_SPEED) {
this.speed = GameLib.CustomCode.MAX_SPEED;
}
this.animation.translationSpeed += GameLib.CustomCode.ANIMATION_SPEED_GRAIN;
this.animation.translationSpeed += GameLib.CustomCode.ANIMATION_SPEED_GRAIN;
if (this.animation.translationSpeed > GameLib.CustomCode.MAX_ANIMATION_SPEED) {
this.animation.translationSpeed = GameLib.CustomCode.MAX_ANIMATION_SPEED;
}
if (this.animation.translationSpeed > GameLib.CustomCode.MAX_ANIMATION_SPEED) {
this.animation.translationSpeed = GameLib.CustomCode.MAX_ANIMATION_SPEED;
}
console.log(this.animation.translationSpeed + ':' + this.speed );
console.log(this.animation.translationSpeed + ':' + this.speed );
}.bind(this)
@ -1245,13 +1245,13 @@ GameLib.CustomCode.prototype.powerup = function(gameObject) {
if (gameObject.type === GameLib.CustomCode.POWERUP_SPEED) {
this.speed -= GameLib.CustomCode.SPEED_GRAIN;
this.speed -= GameLib.CustomCode.POWERUP_SPEED_GRAIN;
if (this.speed < GameLib.CustomCode.MAX_SPEED) {
this.speed = GameLib.CustomCode.MAX_SPEED;
}
this.animation.translationSpeed += GameLib.CustomCode.ANIMATION_SPEED_GRAIN;
this.animation.translationSpeed += GameLib.CustomCode.POWERUP_ANIMATION_SPEED_GRAIN;
if (this.animation.translationSpeed > GameLib.CustomCode.MAX_ANIMATION_SPEED) {
this.animation.translationSpeed = GameLib.CustomCode.MAX_ANIMATION_SPEED;
@ -1261,13 +1261,13 @@ GameLib.CustomCode.prototype.powerup = function(gameObject) {
if (gameObject.type === GameLib.CustomCode.POWERUP_SLOW) {
this.speed += GameLib.CustomCode.SPEED_GRAIN;
this.speed += GameLib.CustomCode.POWERUP_SPEED_GRAIN;
if (this.speed > GameLib.CustomCode.MIN_SPEED) {
this.speed = GameLib.CustomCode.MIN_SPEED;
}
this.animation.translationSpeed -= GameLib.CustomCode.ANIMATION_SPEED_GRAIN;
this.animation.translationSpeed -= GameLib.CustomCode.POWERUP_ANIMATION_SPEED_GRAIN;
if (this.animation.translationSpeed < GameLib.CustomCode.MIN_ANIMATION_SPEED) {
this.animation.translationSpeed = GameLib.CustomCode.MIN_ANIMATION_SPEED;
@ -1777,8 +1777,8 @@ GameLib.Event.Subscribe(
GameLib.CustomCode.POWERUP_WAIT_TIME_MAX
);
this.explodeTime = 0;
this.speedTimer = 0;
this.explodeTime = 0;
this.speedTimer = 0;
/**
* Re-initialize our other custom code components