From 6feaefef2c21b468dca34978fa5646563e309d21 Mon Sep 17 00:00:00 2001 From: Didictateur Date: Sat, 29 Mar 2025 23:15:24 +0100 Subject: [PATCH] ... mais aussi perdre --- src/game.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/game.ts b/src/game.ts index b5b978b..2ce2f78 100644 --- a/src/game.ts +++ b/src/game.ts @@ -565,20 +565,20 @@ export class Game { } private drawResult(): void { + if (this.result !== -1) { + this.staticCtx.fillStyle = "#e0e0f0"; + this.staticCtx.fillRect(450, 430, 150, 190); + this.staticCtx.fillRect(430, 450, 190, 150); + this.staticCtx.fillStyle = "#ff0000"; + this.staticCtx.font = "45px garamond"; + + } if (this.result === 0) { // Égalité - this.staticCtx.fillStyle = "#e0e0f0"; - this.staticCtx.fillRect(450, 430, 150, 190); - this.staticCtx.fillRect(430, 450, 190, 150); - this.staticCtx.fillStyle = "#ff0000"; - this.staticCtx.font = "45px garamond"; - this.staticCtx.fillText("Égalité...", 450, 535); + this.staticCtx.fillText("Égalité", 450, 535); } else if (this.result === 1) { // victoire - this.staticCtx.fillStyle = "#e0e0f0"; - this.staticCtx.fillRect(450, 430, 150, 190); - this.staticCtx.fillRect(430, 450, 190, 150); - this.staticCtx.fillStyle = "#ff0000"; - this.staticCtx.font = "45px garamond"; this.staticCtx.fillText("Victoire !", 440, 535); + } else if (this.result === 2) { // Défaite + this.staticCtx.fillText("Défaite...", 440, 535); } }