add: tictactoe: mobile support

This commit is contained in:
Namonay 2024-05-13 18:12:23 +02:00
parent deba3bcec1
commit 257a897506
2 changed files with 8 additions and 8 deletions

View File

@ -208,10 +208,10 @@ class TicTacToe
{ {
this.context.beginPath(); this.context.beginPath();
this.context.strokeStyle = "green"; this.context.strokeStyle = "green";
this.context.moveTo(targetX + 15, targetY + 15); this.context.moveTo(targetX + 10, targetY + 10);
this.context.lineTo(targetX + 45, targetY + 45); this.context.lineTo(targetX + 40, targetY + 40);
this.context.moveTo(targetX + 45, targetY + 15); this.context.moveTo(targetX + 40, targetY + 10);
this.context.lineTo(targetX + 15, targetY + 45); this.context.lineTo(targetX + 10, targetY + 40);
this.context.stroke(); this.context.stroke();
this.context.closePath(); this.context.closePath();
} }
@ -221,7 +221,7 @@ class TicTacToe
this.context.strokeStyle = "red"; this.context.strokeStyle = "red";
targetX += this.rectsize / 2; targetX += this.rectsize / 2;
targetY += this.rectsize / 2; targetY += this.rectsize / 2;
this.context.arc(targetX, targetY, 20, 0, 2 * Math.PI); this.context.arc(targetX, targetY, 15, 0, 2 * Math.PI);
this.context.stroke(); this.context.stroke();
this.context.closePath(); this.context.closePath();
} }

View File

@ -10,13 +10,13 @@ export class TicTacToeOnlineView extends AbstractView
this.params = params; this.params = params;
this.titleKey = titleKey; this.titleKey = titleKey;
this.game_id = params.id; this.game_id = params.id;
this.height = 560; this.height = 510;
this.width = 560; this.width = 510;
} }
async postInit() async postInit()
{ {
this.Morpion = new TicTacToe(this.height, this.width, 30, 55.5, document.getElementById("Morpion"), this.game_id); this.Morpion = new TicTacToe(this.height, this.width, 30, 50, document.getElementById("Morpion"), this.game_id);
this.Morpion.DrawSuperMorpion(); this.Morpion.DrawSuperMorpion();
await this.Morpion.init(); await this.Morpion.init();
} }