hidden tiles
This commit is contained in:
parent
b131301495
commit
3e0c6e3abe
1 changed files with 8 additions and 2 deletions
|
|
@ -166,13 +166,19 @@
|
||||||
|
|
||||||
// Créer une nouvelle partie et afficher les mains
|
// Créer une nouvelle partie et afficher les mains
|
||||||
const game = new Game();
|
const game = new Game();
|
||||||
console.log(game)
|
|
||||||
for (let i = 0; i < 4; i++) {
|
for (let i = 0; i < 4; i++) {
|
||||||
const handDiv = document.getElementById(`hand-${i}`);
|
const handDiv = document.getElementById(`hand-${i}`);
|
||||||
handDiv.innerHTML = '';
|
handDiv.innerHTML = '';
|
||||||
for (const tile of game.hands[i].tiles) {
|
for (const tile of game.hands[i].tiles) {
|
||||||
const tileDiv = document.createElement('div');
|
const tileDiv = document.createElement('div');
|
||||||
tileDiv.innerHTML = tile.getSVG();
|
if (i === 0) {
|
||||||
|
tileDiv.innerHTML = tile.getSVG();
|
||||||
|
} else {
|
||||||
|
tileDiv.innerHTML = `<svg class="tile tile-back" viewBox="0 0 310 410" height="82" width="60">
|
||||||
|
<image href="/img/Regular/Gray.svg" x="10" y="10" height="410" width="310"/>
|
||||||
|
<image href="/img/Regular/Back.svg" x="0" y="0" height="410" width="310"/>
|
||||||
|
</svg>`;
|
||||||
|
}
|
||||||
handDiv.appendChild(tileDiv);
|
handDiv.appendChild(tileDiv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue