Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 75 bytes modified
parent
e5e8ec9c54
commit
a7939f8e07
|
@ -181,27 +181,27 @@ this.state = {
|
||||||
|
|
||||||
GameLib.CustomCode.prototype.advanceSpeedTimer = function(delta) {
|
GameLib.CustomCode.prototype.advanceSpeedTimer = function(delta) {
|
||||||
|
|
||||||
this.speedTimer += delta;
|
this.speedTimer += delta;
|
||||||
|
|
||||||
if (this.speedTimer < GameLib.CustomCode.SPEED_INCREASE_INTERVAL) {
|
if (this.speedTimer < GameLib.CustomCode.SPEED_INCREASE_INTERVAL) {
|
||||||
return;
|
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) {
|
if (this.speed < GameLib.CustomCode.MAX_SPEED) {
|
||||||
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) {
|
if (this.animation.translationSpeed > GameLib.CustomCode.MAX_ANIMATION_SPEED) {
|
||||||
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)
|
}.bind(this)
|
||||||
|
|
||||||
|
@ -1245,13 +1245,13 @@ GameLib.CustomCode.prototype.powerup = function(gameObject) {
|
||||||
|
|
||||||
if (gameObject.type === GameLib.CustomCode.POWERUP_SPEED) {
|
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) {
|
if (this.speed < GameLib.CustomCode.MAX_SPEED) {
|
||||||
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) {
|
if (this.animation.translationSpeed > GameLib.CustomCode.MAX_ANIMATION_SPEED) {
|
||||||
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) {
|
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) {
|
if (this.speed > GameLib.CustomCode.MIN_SPEED) {
|
||||||
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) {
|
if (this.animation.translationSpeed < GameLib.CustomCode.MIN_ANIMATION_SPEED) {
|
||||||
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
|
GameLib.CustomCode.POWERUP_WAIT_TIME_MAX
|
||||||
);
|
);
|
||||||
|
|
||||||
this.explodeTime = 0;
|
this.explodeTime = 0;
|
||||||
this.speedTimer = 0;
|
this.speedTimer = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Re-initialize our other custom code components
|
* Re-initialize our other custom code components
|
||||||
|
|
Loading…
Reference in New Issue