Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-05-28 15:42:04 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-05-28 15:42:04 -0700
commitabc8b02a9c73e68f435d8971b2ef0e1970f42212 (patch)
treea3660f4791baf571c6c4f0822f896aa5b171631b /src/modules/gameboard.js
parent528a370ddcf9bc63b0b5ec757ee2ac97c505131e (diff)
WIP: select counter test
Diffstat (limited to 'src/modules/gameboard.js')
-rw-r--r--src/modules/gameboard.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modules/gameboard.js b/src/modules/gameboard.js
index a354795..38a9a9a 100644
--- a/src/modules/gameboard.js
+++ b/src/modules/gameboard.js
@@ -200,7 +200,8 @@ function endMove() {
export function start(el) {
svg = el;
- getUnits(svg).forEach(unit => unit.addEventListener('click', selectOffBoard));
+ const startingLocations = svg.querySelector('.start-locations');
+ startingLocations && getUnits(startingLocations).forEach(unit => unit.addEventListener('click', selectOffBoard));
getCells(svg).forEach(cell => {
cell.addEventListener('click', e => {