diff --git a/entities.js b/entities.js index 79ec74b..bb9b2c4 100644 --- a/entities.js +++ b/entities.js @@ -27,15 +27,26 @@ var Clock = function(sideLength) { while(lane < 0) { lane = lane + this.sides; } + block.distFromHex = MainClock.sideLength / 2 * Math.sqrt(3) + block.height * this.blocks[lane].length + block.height/2; this.blocks[lane].push(block); } this.rotate = function(steps) { + var oldPosition = this.position; this.position += steps; this.position = this.position % this.sides; while(this.position < 0) { this.position = this.position + this.sides; } + for(var i=0; i