Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 607 bytes modified
parent
9d0aa33265
commit
f2572e8c38
|
@ -176,6 +176,30 @@ this.state = {
|
|||
gameOver : false
|
||||
};
|
||||
|
||||
GameLib.CustomCode.prototype.advanceSpeedTimer = function(delta) {
|
||||
|
||||
this.speedTimer += delta;
|
||||
|
||||
if (this.speedTimer < GameLib.CustomCode.SPEED_INCREASE_INTERVAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.speedTimer = 0;
|
||||
|
||||
this.speed -= GameLib.CustomCode.SPEED_GRAIN;
|
||||
|
||||
if (this.speed < GameLib.CustomCode.MAX_SPEED) {
|
||||
this.speed = GameLib.CustomCode.MAX_SPEED;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}.bind(this)
|
||||
|
||||
GameLib.CustomCode.prototype.displayHUD = function() {
|
||||
|
||||
this.canvasHUD.clear();
|
||||
|
|
Loading…
Reference in New Issue