index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
author | Catalin Mititiuc <webdevcat@proton.me> | 2024-07-30 21:02:13 -0700 |
---|---|---|
committer | Catalin Mititiuc <webdevcat@proton.me> | 2024-07-30 21:08:00 -0700 |
commit | 1687e0e790d869fe58f86046f5ee093981670c63 (patch) | |
tree | 212e0c3127483ec29774ac237c07e00b26f05086 /src/radial.js | |
parent | 48e7675eb0583e420dac52be341e505331c05b4b (diff) |
Ok, hover and firing arc doesn't get stuck at all
Not sure about counters
Diffstat (limited to 'src/radial.js')
-rw-r--r-- | src/radial.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/radial.js b/src/radial.js index 09037ab..7c7c0f3 100644 --- a/src/radial.js +++ b/src/radial.js @@ -1,5 +1,6 @@ const xmlns = 'http://www.w3.org/2000/svg'; const grid = document.querySelector('svg .grid'); +const frontmost = grid.querySelector('.frontmost'); const hex = { inradius: 8.66, @@ -247,10 +248,10 @@ function drawBuildings(buildings, container, { q: pq, r: pr, s: ps }, features) }, new Map()); } -function drawMapsheet(gameboard, mapsheet, position) { +function drawMapsheet(placementMarker, mapsheet, position) { const container = document.createElementNS(xmlns, 'g'); container.classList.add(mapsheet.id); - gameboard.appendChild(container); + placementMarker.before(container); const buildingContainer = document.createElementNS(xmlns, 'g'); buildingContainer.classList.add(mapsheet.id); @@ -440,11 +441,13 @@ findScalar(findMult(sheets), +width + 1, +height).forEach(([vscalar, row]) => { return vectorAdd(coords, { q: -1, r: 0, s: 1 }, hscalar); } - ms = drawMapsheet(grid, ms, horzMapVect(vertMapVect({ q: 0, r: 0, s: 0 }))); + ms = drawMapsheet(frontmost, ms, horzMapVect(vertMapVect({ q: 0, r: 0, s: 0 }))); finalGrid = new Map([...finalGrid, ...ms]); }) }); +document.querySelector('.grid .mapsheets').remove(); + function addGroup(container, className) { const g = document.createElementNS(xmlns, 'g'); g.classList.add(className); |