diff --git a/src/engine/game-state.js b/src/engine/game-state.js index 2ea4d4f..dd6af2f 100644 --- a/src/engine/game-state.js +++ b/src/engine/game-state.js @@ -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 }); } diff --git a/src/entities/puck.js b/src/entities/puck.js index 5fdb406..e1e9c5e 100644 --- a/src/entities/puck.js +++ b/src/entities/puck.js @@ -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; diff --git a/src/systems/renderer.js b/src/systems/renderer.js index 33cbd2d..0810f20 100644 --- a/src/systems/renderer.js +++ b/src/systems/renderer.js @@ -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) {