diff --git a/21g30t1e75.js b/21g30t1e75.js index 927575d..b8c0233 100644 --- a/21g30t1e75.js +++ b/21g30t1e75.js @@ -225,7 +225,8 @@ this.state = { message : null, gameOver : false, muted : false, - paused : false + paused : false, + score : 0 }; GameLib.CustomCode.prototype.advanceSpeedTimer = function(delta) { @@ -1270,7 +1271,7 @@ GameLib.CustomCode.prototype.extend = function(gameObject, position, orientation this.food.indexOf(gameObject), 1 ); - + gameObject.dispose(); this.grid[body.position.x][body.position.y] = body; @@ -1295,7 +1296,9 @@ GameLib.CustomCode.prototype.extend = function(gameObject, position, orientation this.animation.translationSpeed = GameLib.CustomCode.MAX_ANIMATION_SPEED; } - console.log('speed = ' + this.speed); + this.state.score += (1 - this.speed) * 21; + + //console.log('speed = ' + this.speed); }.bind(this); @@ -1816,7 +1819,8 @@ GameLib.Event.Subscribe( message : null, gameOver : false, muted : this.state.muted, - paused : false + paused : false, + score : 0 }; GameLib.Event.Emit(