Rebranding: changement PACMAN en OULVIC et design rétro années 80 pour les fantômes
This commit is contained in:
48
game.js
48
game.js
@ -327,31 +327,49 @@ class Ghost {
|
||||
draw() {
|
||||
ctx.save();
|
||||
ctx.translate(this.pixelX, this.pixelY);
|
||||
|
||||
const size = CELL_SIZE * 0.4;
|
||||
|
||||
ctx.fillStyle = this.color;
|
||||
ctx.strokeStyle = '#000000';
|
||||
ctx.lineWidth = 2;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, -CELL_SIZE * 0.15, CELL_SIZE * 0.3, Math.PI, 0, false);
|
||||
ctx.rect(-CELL_SIZE * 0.3, -CELL_SIZE * 0.15, CELL_SIZE * 0.6, CELL_SIZE * 0.45);
|
||||
ctx.arc(0, -size * 0.3, size * 0.5, Math.PI, 0, false);
|
||||
ctx.fill();
|
||||
|
||||
ctx.stroke();
|
||||
|
||||
ctx.fillRect(-size * 0.5, -size * 0.3, size * 1.0, size * 0.7);
|
||||
ctx.strokeRect(-size * 0.5, -size * 0.3, size * 1.0, size * 0.7);
|
||||
|
||||
const waveHeight = size * 0.15;
|
||||
const waveWidth = size * 0.2;
|
||||
ctx.beginPath();
|
||||
ctx.rect(-CELL_SIZE * 0.3, CELL_SIZE * 0.3, CELL_SIZE * 0.2, CELL_SIZE * 0.2);
|
||||
ctx.rect(-CELL_SIZE * 0.1, CELL_SIZE * 0.3, CELL_SIZE * 0.2, CELL_SIZE * 0.2);
|
||||
ctx.rect(CELL_SIZE * 0.1, CELL_SIZE * 0.3, CELL_SIZE * 0.2, CELL_SIZE * 0.2);
|
||||
ctx.moveTo(-size * 0.5, size * 0.4);
|
||||
for (let i = 0; i < 5; i++) {
|
||||
const x = -size * 0.5 + i * waveWidth;
|
||||
const y = size * 0.4 + (i % 2 === 0 ? 0 : waveHeight);
|
||||
ctx.lineTo(x, y);
|
||||
}
|
||||
ctx.lineTo(size * 0.5, size * 0.4);
|
||||
ctx.lineTo(size * 0.5, size * 0.7);
|
||||
ctx.lineTo(-size * 0.5, size * 0.7);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
|
||||
ctx.fillStyle = '#fff';
|
||||
ctx.stroke();
|
||||
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.beginPath();
|
||||
ctx.arc(-CELL_SIZE * 0.15, -CELL_SIZE * 0.1, CELL_SIZE * 0.08, 0, Math.PI * 2);
|
||||
ctx.arc(CELL_SIZE * 0.15, -CELL_SIZE * 0.1, CELL_SIZE * 0.08, 0, Math.PI * 2);
|
||||
ctx.arc(-size * 0.2, -size * 0.1, size * 0.12, 0, Math.PI * 2);
|
||||
ctx.arc(size * 0.2, -size * 0.1, size * 0.12, 0, Math.PI * 2);
|
||||
ctx.fill();
|
||||
|
||||
ctx.fillStyle = '#000';
|
||||
|
||||
ctx.fillStyle = '#000000';
|
||||
ctx.beginPath();
|
||||
ctx.arc(-CELL_SIZE * 0.15, -CELL_SIZE * 0.1, CELL_SIZE * 0.04, 0, Math.PI * 2);
|
||||
ctx.arc(CELL_SIZE * 0.15, -CELL_SIZE * 0.1, CELL_SIZE * 0.04, 0, Math.PI * 2);
|
||||
ctx.arc(-size * 0.2, -size * 0.1, size * 0.06, 0, Math.PI * 2);
|
||||
ctx.arc(size * 0.2, -size * 0.1, size * 0.06, 0, Math.PI * 2);
|
||||
ctx.fill();
|
||||
|
||||
|
||||
ctx.restore();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user