removed clock hand
This commit is contained in:
parent
95e7c1b0db
commit
cb42564bb3
1 changed files with 0 additions and 20 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)';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue