//you can change these to sexier stuff var colors = [ "black", "orange", "red", "blue", ]; var Clock = function(sideLength) { this.position = 0; this.sides = 6; this.blocks = []; this.angle = 30; this.sideLength = sideLength; this.strokeColor = 'black'; this.x = canvas.width / 2; this.y = canvas.height / 2; for(var i=0; i< this.sides; i++) { this.blocks.push([]); } this.addBlock = function(block) { var lane = 0; lane += this.position + block.lane; lane = lane % this.sides; while(lane < 0) { lane = lane + this.sides; } block.distFromHex = MainClock.sideLength / 2 * Math.sqrt(3) + block.height * this.blocks[lane].length; 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