Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-07-23 15:05:58 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-07-23 15:05:58 -0700
commit5fc598cdd15be3d8dd856997af2b1f68f774162c (patch)
treead964b16b065e859a5c71e7ff294c86f14ad77e4 /src/modules/game
parent9d44de5f114cacd915661ef5b2af3e5098fee3b8 (diff)
WIP: counters
Diffstat (limited to 'src/modules/game')
-rw-r--r--src/modules/game/soldier.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/modules/game/soldier.js b/src/modules/game/soldier.js
index 3ac7b37..a024f9f 100644
--- a/src/modules/game/soldier.js
+++ b/src/modules/game/soldier.js
@@ -108,6 +108,18 @@ export function getTrace(svg, counter) {
}
export function place(svg, selected, cell) {
+ //console.log(selected.parentElement);
+ //const piecesContainer = svg.querySelector('.pieces');
+ //const parent = selected.parentElement;
+ //if (parent)
+ // parent.setAttributeNS(null, 'transform', cell.getAttributeNS(null, 'transform'));
+ //else {
+ // const container = document.createElementNS(svgns, 'g');
+ // container.setAttributeNS(null, 'transform', cell.getAttributeNS(null, 'transform'));
+ // container.append(selected);
+ // piecesContainer.append(container);
+ //}
+
if (svg.querySelector('.grid').contains(selected)) {
const clone = addMoveToHistory(selected);
updatePlacement(cell, selected, clone)