Merge branch 'gh-pages' of http://github.com/teamsnowman/hextris into gh-pages
This commit is contained in:
commit
94650522b5
2 changed files with 3 additions and 21 deletions
20
js/Clock.js
20
js/Clock.js
|
@ -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)';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue