index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/modules/game')
-rw-r--r-- | src/modules/game/soldier.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/modules/game/soldier.js b/src/modules/game/soldier.js index 8e2725d..1555c19 100644 --- a/src/modules/game/soldier.js +++ b/src/modules/game/soldier.js @@ -63,6 +63,18 @@ function createTrace(previous, current, selected) { return trace; } +export function createCounter(selected) { + const use = document.createElementNS(svgns, 'use'); + const g = document.createElementNS(svgns, 'g'); + use.setAttributeNS(null, 'href', `#t-${selected.dataset.number}`); + g.classList.add('counter'); + g.dataset.allegiance = selected.dataset.allegiance; + g.dataset.number = selected.dataset.number; + g.appendChild(use); + + return g; +} + export function handleTrace(svg, selected, clone, current) { let trace = getTrace(svg, selected); |