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

beta.r3js.org
-=yb4f310 2018-03-24 15:43:53 +01:00
parent 9d0aa33265
commit f2572e8c38
1 changed files with 24 additions and 0 deletions

View File

@ -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();