Web Dev Solutions

Catalin Mititiuc

From 5fc598cdd15be3d8dd856997af2b1f68f774162c Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Tue, 23 Jul 2024 15:05:58 -0700 Subject: WIP: counters --- src/modules/game/soldier.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/modules/game/soldier.js') 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) -- cgit v1.2.3