fix: matchmaking: QOL and typos

This commit is contained in:
Namonay 2024-05-07 14:43:04 +02:00
parent 73828bbd8e
commit 821d4b9154
5 changed files with 15 additions and 6 deletions

View File

@ -90,14 +90,24 @@ class TicTacToe
this.context.fillRect(this.width / 2 - 200, this.height - this.gap + 10, 400, 80);
this.context.closePath();
this.context.beginPath();
this.context.font = `20px sans-serif`;
this.context.fillStyle = (winning_sign == "o") ? "red" : "green";
this.context.fillText((winning_sign == "o") ? lang.get("morpionWin") + "O" : lang.get("morpionWin") + "X", this.width / 2 - 30, this.height - this.gap / 2, 140);
this.context.fillText((winning_sign == "o") ? lang.get("morpionWin") + "O" : lang.get("morpionWin") + "X", this.width / 2 - 85, this.height - this.gap / 2 + 10, 180);
}
printTimer()
{
let sec = 20;
let turn = this.turn
if (this.turn)
{
this.context.beginPath();
this.context.fillStyle = "white";
this.context.font = `40px Verdana`;
this.context.fillText(sec, this.width / 2, this.gap / 2);
this.context.closePath();
sec--;
}
let id = setInterval(() =>
{
this.context.beginPath();
@ -117,7 +127,6 @@ class TicTacToe
this.context.fillStyle = "white";
this.context.font = `40px Verdana`;
this.context.fillText(sec, this.width / 2, this.gap / 2);
this.context.font = `inherit`;
this.context.closePath();
}
sec--;