j'arrive a ecrire du html a droite
This commit is contained in:
parent
2390797b49
commit
8afa2c7b1b
@ -25,17 +25,13 @@ export default class extends AbstractView
|
|||||||
|
|
||||||
onClick(event)
|
onClick(event)
|
||||||
{
|
{
|
||||||
console.log(this);
|
|
||||||
let targetTabX, targetTabY, targetTab;
|
let targetTabX, targetTabY, targetTab;
|
||||||
let squareTab;
|
let squareTab;
|
||||||
let x = event.offsetX;
|
let x = event.offsetX;
|
||||||
let y = event.offsetY;
|
let y = event.offsetY;
|
||||||
|
|
||||||
if (this.Winner != -1)
|
if (this.Winner != -1)
|
||||||
{
|
|
||||||
console.log("end of game, Winner is : " + this.Winner);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
function findPlace(x, morpion)
|
function findPlace(x, morpion)
|
||||||
{
|
{
|
||||||
@ -135,10 +131,8 @@ export default class extends AbstractView
|
|||||||
|
|
||||||
function updateMorpion(targetTab, squareTab, morpion)
|
function updateMorpion(targetTab, squareTab, morpion)
|
||||||
{
|
{
|
||||||
console.log("targettab : " + targetTab + " squaretab : " + squareTab + " playerturn : " + morpion.playerTurn);
|
|
||||||
if (morpion.playerTurn && targetTab != morpion.playerTwoCurrentTab)
|
if (morpion.playerTurn && targetTab != morpion.playerTwoCurrentTab)
|
||||||
return -1;
|
return -1;
|
||||||
console.log("targettab : " + targetTab + " squaretab : " + squareTab);
|
|
||||||
if (!morpion.playerTurn && targetTab != morpion.playerOneCurrentTab)
|
if (!morpion.playerTurn && targetTab != morpion.playerOneCurrentTab)
|
||||||
return -1;
|
return -1;
|
||||||
if (morpion.morpion[targetTab][squareTab] == -1)
|
if (morpion.morpion[targetTab][squareTab] == -1)
|
||||||
@ -155,7 +149,6 @@ export default class extends AbstractView
|
|||||||
checkForWinningMove(morpion, targetTab);
|
checkForWinningMove(morpion, targetTab);
|
||||||
if (morpion.Winner != -1)
|
if (morpion.Winner != -1)
|
||||||
{
|
{
|
||||||
console.log((morpion.Winner) ? "Winner is O" : "Winner is X");
|
|
||||||
paintWinningNotification(morpion);
|
paintWinningNotification(morpion);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -245,8 +238,10 @@ export default class extends AbstractView
|
|||||||
{
|
{
|
||||||
return `
|
return `
|
||||||
<h1>${lang.get('ticTacToe')}</h1>
|
<h1>${lang.get('ticTacToe')}</h1>
|
||||||
|
<div style="display: flex">
|
||||||
<canvas id="Morpion" width="${this.width}" height="${this.height}"></canvas>
|
<canvas id="Morpion" width="${this.width}" height="${this.height}"></canvas>
|
||||||
<h2>J'arrive pas a ecrire du html a droite 🤓🤓🤓🤓</h2>
|
<h2 style="margin-left: 5%">J'arrive a ecrire du html a droite 🤓🤓🤓🤓</h2>
|
||||||
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user