fix space between goalie and goal

This commit is contained in:
Pierre Wessman 2025-09-16 11:18:20 +02:00
parent 3e95801351
commit 69c2d2282d
3 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,7 @@ class GameEngine {
setupPlayers() {
const homeTeamPositions = [
{ role: 'G', x: 80, y: 300 },
{ role: 'G', x: 10, y: 300 },
{ role: 'LD', x: 200, y: 220 },
{ role: 'RD', x: 200, y: 380 },
{ role: 'LW', x: 350, y: 200 },
@ -32,7 +32,7 @@ class GameEngine {
];
const awayTeamPositions = [
{ role: 'G', x: 920, y: 300 },
{ role: 'G', x: 970, y: 300 },
{ role: 'LD', x: 800, y: 220 },
{ role: 'RD', x: 800, y: 380 },
{ role: 'LW', x: 650, y: 200 },

View File

@ -167,8 +167,8 @@ class Player {
updateGoalie(gameState, puck, players) {
const goal = this.team === 'home' ?
new Vector2(50, gameState.rink.centerY) :
new Vector2(gameState.rink.width - 50, gameState.rink.centerY);
new Vector2(10, gameState.rink.centerY) :
new Vector2(gameState.rink.width - 10, gameState.rink.centerY);
const crease = {
x: goal.x - 30,

View File

@ -111,12 +111,12 @@ class Renderer {
const goalY = rink.centerY;
this.ctx.beginPath();
this.ctx.arc(60, goalY, creaseRadius, -Math.PI/2, Math.PI/2);
this.ctx.arc(0, goalY, creaseRadius, -Math.PI/2, Math.PI/2);
this.ctx.fill();
this.ctx.stroke();
this.ctx.beginPath();
this.ctx.arc(rink.width - 60, goalY, creaseRadius, Math.PI/2, -Math.PI/2);
this.ctx.arc(rink.width, goalY, creaseRadius, Math.PI/2, -Math.PI/2);
this.ctx.fill();
this.ctx.stroke();
}