...
This commit is contained in:
parent
14e0794aae
commit
cb8d4919a7
@ -168,7 +168,6 @@ class GameState {
|
||||
location: location,
|
||||
participants: { home: null, away: null }
|
||||
};
|
||||
console.log('Faceoff state set to:', this.faceoff);
|
||||
this.emit('faceoff-start', { location });
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ class Puck {
|
||||
this.radius = 8;
|
||||
this.mass = 0.5;
|
||||
this.restitution = 0.9;
|
||||
this.friction = 3;
|
||||
this.friction = 1;
|
||||
|
||||
this.lastPlayerTouch = null;
|
||||
this.lastTeamTouch = null;
|
||||
|
||||
@ -56,15 +56,17 @@ class Renderer {
|
||||
}
|
||||
|
||||
drawRinkLines(rink) {
|
||||
// Outer lines
|
||||
this.ctx.strokeStyle = '#d32f2f';
|
||||
this.ctx.lineWidth = 3;
|
||||
|
||||
// Zone lines
|
||||
this.ctx.beginPath();
|
||||
this.ctx.rect(0, 0, rink.width, rink.height);
|
||||
this.ctx.stroke();
|
||||
|
||||
this.ctx.strokeStyle = '#2196f3';
|
||||
this.ctx.lineWidth = 2;
|
||||
this.ctx.strokeStyle = '#d32f2f';
|
||||
this.ctx.lineWidth = 3;
|
||||
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(rink.centerX, 0);
|
||||
@ -73,7 +75,6 @@ class Renderer {
|
||||
|
||||
const zoneWidth = rink.width / 3;
|
||||
this.ctx.strokeStyle = '#2196f3';
|
||||
this.ctx.setLineDash([10, 5]);
|
||||
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(zoneWidth, 0);
|
||||
@ -85,11 +86,22 @@ class Renderer {
|
||||
this.ctx.lineTo(rink.width - zoneWidth, rink.height);
|
||||
this.ctx.stroke();
|
||||
|
||||
this.ctx.setLineDash([]);
|
||||
|
||||
this.ctx.beginPath();
|
||||
this.ctx.arc(rink.centerX, rink.centerY, 100, 0, Math.PI * 2);
|
||||
this.ctx.stroke();
|
||||
|
||||
// Goal lines
|
||||
this.ctx.strokeStyle = '#d32f2f';
|
||||
this.ctx.lineWidth = 3;
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(this.goalXOffset, 0);
|
||||
this.ctx.lineTo(this.goalXOffset, rink.height);
|
||||
this.ctx.stroke();
|
||||
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(rink.width - this.goalXOffset, 0);
|
||||
this.ctx.lineTo(rink.width - this.goalXOffset, rink.height);
|
||||
this.ctx.stroke();
|
||||
}
|
||||
|
||||
drawGoals(rink) {
|
||||
@ -117,19 +129,6 @@ class Renderer {
|
||||
this.ctx.fillStyle = 'rgba(211, 47, 47, 0.1)';
|
||||
this.ctx.fillRect(this.goalXOffset - goalDepth, goalY - goalHeight, goalDepth, goalHeight * 2);
|
||||
this.ctx.fillRect(rink.width - this.goalXOffset, goalY - goalHeight, goalDepth, goalHeight * 2);
|
||||
|
||||
// Goal lines
|
||||
this.ctx.strokeStyle = '#d32f2f';
|
||||
this.ctx.lineWidth = 3;
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(this.goalXOffset, 0);
|
||||
this.ctx.lineTo(this.goalXOffset, rink.height);
|
||||
this.ctx.stroke();
|
||||
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(rink.width - this.goalXOffset, 0);
|
||||
this.ctx.lineTo(rink.width - this.goalXOffset, rink.height);
|
||||
this.ctx.stroke();
|
||||
}
|
||||
|
||||
drawCreases(rink) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user