summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'play.js')
-rw-r--r--play.js24
1 files changed, 14 insertions, 10 deletions
diff --git a/play.js b/play.js
index 615c25a..6c4fe02 100644
--- a/play.js
+++ b/play.js
@@ -1,5 +1,7 @@
"use strict"
+// TODO: intermediate regroup moves
+
// https://www.redblobgames.com/grids/hexagons/
const svgNS = "http://www.w3.org/2000/svg"
@@ -371,7 +373,7 @@ function update_map() {
if (stack[hex] === ui.focus) {
x = ui.hex_x[hex] - 25
- y = ui.hex_y[hex] - 25 + i * 54
+ y = ui.hex_y[hex] - 25 + i * 56
z = 100
} else {
if (stack[hex].length <= 1) {
@@ -381,11 +383,11 @@ function update_map() {
x = ui.hex_x[hex] - 30 + i * 11
y = ui.hex_y[hex] - 30 + i * 14
} else if (stack[hex].length <= 8) {
- x = ui.hex_x[hex] - 35 + i * 4
- y = ui.hex_y[hex] - 35 + i * 4
+ x = ui.hex_x[hex] - 30 + i * 4
+ y = ui.hex_y[hex] - 30 + i * 4
} else {
- x = ui.hex_x[hex] - 35 + i * 2
- y = ui.hex_y[hex] - 35 + i * 2
+ x = ui.hex_x[hex] - 35 + i * 3
+ y = ui.hex_y[hex] - 35 + i * 3
}
z = 1 + i
}
@@ -466,14 +468,16 @@ function update_battle() {
update_battle_line(ui.battle_line_1, is_allied_unit)
update_battle_line(ui.battle_line_2, is_axis_unit)
}
- target_button("target_armor")
- target_button("target_infantry")
- target_button("target_antitank")
- target_button("target_artillery")
+ target_button("armor")
+ target_button("infantry")
+ target_button("antitank")
+ target_button("artillery")
+ for (let i = 0; i < 4; ++i)
+ ui.battle_hits[i].textContent = view.hits[i]
}
function target_button(action) {
- let button = document.getElementById(action + "_button")
+ let button = document.getElementById("target_" + action + "_button")
if (view.actions) {
button.classList.remove("hide")
if (view.actions[action])