Merge branch 'gh-pages' of http://github.com/teamsnowman/hextris into gh-pages

This commit is contained in:
garrettdreyfus 2014-05-26 12:46:12 -04:00
commit 94650522b5
2 changed files with 3 additions and 21 deletions

View file

@ -151,25 +151,5 @@ function Clock(sideLength) {
this.angle += this.angularVelocity;
}
drawPolygon(this.x + gdx, this.y + gdy + this.dy, this.sides, this.sideLength, this.angle, this.fillColor, 0, 'rgba(0,0,0,0)');
this.drawClockHand();
};
this.drawClockHand = function() {
ctx.beginPath();
var handColor = '#7f8c8d';
ctx.lineWidth = 3;
ctx.strokeStyle = handColor;
ctx.moveTo(this.x, this.y);
if(Date.now()-this.lastCombo >5000){
var handAngle =0;
}
else {
var handAngle = (360 * (Date.now() - this.lastCombo) / 5000);
}
var coords = rotatePoint(0, this.sideLength / 2 * Math.sqrt(3), (handAngle+180)%360);
ctx.lineTo(this.x + coords.x, this.y + coords.y);
ctx.stroke();
ctx.strokeStyle = 'rgba(0,0,0,0)';
}
}

View file

@ -156,7 +156,9 @@ function init() {
MainClock = saveState.clock || new Clock(settings.hexWidth);
for(var i=0; i<MainClock.blocks.length; i++) {
for(var j=0; j<MainClock.blocks[i].length; j++) {
MainClock.blocks[i][j].settled = 0;
var block = MainClock.blocks[i][j];
block.distFromHex = 2 * MainClock.sideLength / Math.sqrt(3) + (j-1) * block.height;
block.settled = 0;
}
}