fix space between goalie and goal
This commit is contained in:
parent
3e95801351
commit
69c2d2282d
@ -23,7 +23,7 @@ class GameEngine {
|
|||||||
|
|
||||||
setupPlayers() {
|
setupPlayers() {
|
||||||
const homeTeamPositions = [
|
const homeTeamPositions = [
|
||||||
{ role: 'G', x: 80, y: 300 },
|
{ role: 'G', x: 10, y: 300 },
|
||||||
{ role: 'LD', x: 200, y: 220 },
|
{ role: 'LD', x: 200, y: 220 },
|
||||||
{ role: 'RD', x: 200, y: 380 },
|
{ role: 'RD', x: 200, y: 380 },
|
||||||
{ role: 'LW', x: 350, y: 200 },
|
{ role: 'LW', x: 350, y: 200 },
|
||||||
@ -32,7 +32,7 @@ class GameEngine {
|
|||||||
];
|
];
|
||||||
|
|
||||||
const awayTeamPositions = [
|
const awayTeamPositions = [
|
||||||
{ role: 'G', x: 920, y: 300 },
|
{ role: 'G', x: 970, y: 300 },
|
||||||
{ role: 'LD', x: 800, y: 220 },
|
{ role: 'LD', x: 800, y: 220 },
|
||||||
{ role: 'RD', x: 800, y: 380 },
|
{ role: 'RD', x: 800, y: 380 },
|
||||||
{ role: 'LW', x: 650, y: 200 },
|
{ role: 'LW', x: 650, y: 200 },
|
||||||
|
|||||||
@ -167,8 +167,8 @@ class Player {
|
|||||||
|
|
||||||
updateGoalie(gameState, puck, players) {
|
updateGoalie(gameState, puck, players) {
|
||||||
const goal = this.team === 'home' ?
|
const goal = this.team === 'home' ?
|
||||||
new Vector2(50, gameState.rink.centerY) :
|
new Vector2(10, gameState.rink.centerY) :
|
||||||
new Vector2(gameState.rink.width - 50, gameState.rink.centerY);
|
new Vector2(gameState.rink.width - 10, gameState.rink.centerY);
|
||||||
|
|
||||||
const crease = {
|
const crease = {
|
||||||
x: goal.x - 30,
|
x: goal.x - 30,
|
||||||
|
|||||||
@ -111,12 +111,12 @@ class Renderer {
|
|||||||
const goalY = rink.centerY;
|
const goalY = rink.centerY;
|
||||||
|
|
||||||
this.ctx.beginPath();
|
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.fill();
|
||||||
this.ctx.stroke();
|
this.ctx.stroke();
|
||||||
|
|
||||||
this.ctx.beginPath();
|
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.fill();
|
||||||
this.ctx.stroke();
|
this.ctx.stroke();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user