summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-08-20 16:17:36 +0200
committerTor Andersson <tor@ccxvii.net>2023-10-01 16:11:22 +0200
commit6cab873fa90a25a5247c3ce9c6c04bb8f895848b (patch)
tree01efdabbb1ee226409906170fd32f4d36b00e992 /play.js
parent5a80ae369c23c62db3b3fdb4e93281d4b1ade026 (diff)
downloadwaterloo-campaign-1815-6cab873fa90a25a5247c3ce9c6c04bb8f895848b.tar.gz
Angst.
Diffstat (limited to 'play.js')
-rw-r--r--play.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/play.js b/play.js
index 4f80fc8..a661ae1 100644
--- a/play.js
+++ b/play.js
@@ -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)