diff --git a/21g30t1e75.js b/21g30t1e75.js index a3feae9..45e302f 100644 --- a/21g30t1e75.js +++ b/21g30t1e75.js @@ -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();