diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-08-20 16:17:36 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-10-01 16:11:22 +0200 |
commit | 6cab873fa90a25a5247c3ce9c6c04bb8f895848b (patch) | |
tree | 01efdabbb1ee226409906170fd32f4d36b00e992 /play.js | |
parent | 5a80ae369c23c62db3b3fdb4e93281d4b1ade026 (diff) | |
download | waterloo-campaign-1815-6cab873fa90a25a5247c3ce9c6c04bb8f895848b.tar.gz |
Angst.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -1,6 +1,7 @@ "use strict" const ELIMINATED = 0 +const SWAPPED = 200 const REINFORCEMENTS = 100 const AVAILABLE_P1 = 101 const AVAILABLE_P2 = 102 @@ -252,7 +253,7 @@ function on_update() { let hex = view.pieces[id] >> 1 let z = 0 let s = 0 - if (hex > BLOWN && hex < first_hex) + if (hex > BLOWN && hex < BLOWN + 20) hex -= BLOWN if (hex >= first_hex || hex === REINFORCEMENTS) { // ON MAP @@ -294,7 +295,7 @@ function on_update() { ui.pieces[id].style.top = y + "px" ui.pieces[id].style.left = x + "px" ui.pieces[id].style.zIndex = 0 - } else if (hex >= 1) { + } else if (hex >= 1 && hex <= 20) { // ON TURN TRACK ui.pieces[id].classList.remove("hide") ui.pieces[id].classList.remove("flip") @@ -311,15 +312,12 @@ function on_update() { ui.pieces[id].style.top = y + "px" ui.pieces[id].style.left = x + "px" } else { - // TODO: ENTRY HEXES - // ELIMINATED + // ELIMINATED or SWAPPED ui.pieces[id].classList.add("hide") } //if (is_action("piece", id)) z = 101 - if (view.target === id) - z = 102 - if (view.who === id) - z = 103 + if (view.target === id) z = 102 + if (view.who === id) z = 103 ui.pieces[id].style.zIndex = z ui.pieces[id].classList.toggle("action", is_action("piece", id)) ui.pieces[id].classList.toggle("selected", view.who === id) |