summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-07-15 23:46:26 +0000
committerTor Andersson <tor@ccxvii.net>2023-07-16 13:37:42 +0200
commitfaa5c18754f9d59ccc8264a7d5af7a21e2134e3c (patch)
tree8662bc5e40ee5f31e7399904653fde08bb8b13b5
parent3d1a876b4fc7da13a58148f3bfa0e6ba9031b5e7 (diff)
downloadfield-cloth-gold-faa5c18754f9d59ccc8264a7d5af7a21e2134e3c.tar.gz
Tweak score layout.
-rw-r--r--play.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/play.js b/play.js
index 85179ae..3bd9245 100644
--- a/play.js
+++ b/play.js
@@ -66,7 +66,8 @@ const LAYOUT_SCORE_39 = [748,547,46,46]
const SCORE_X0 = LAYOUT_SCORE_0[0] + TOKEN_DX + BOARD_X
const SCORE_Y0 = LAYOUT_SCORE_0[1] + TOKEN_DY + BOARD_Y
const SCORE_DX = (LAYOUT_SCORE_39[0] - LAYOUT_SCORE_0[0] + 4) / 7
-const SCORE_DY = (LAYOUT_SCORE_39[1] - LAYOUT_SCORE_0[1] + 0) / 4
+const SCORE_DY = (LAYOUT_SCORE_39[1] - LAYOUT_SCORE_0[1]) / 4
+const SCORE_DXDY = -1
let ui = {
board: document.getElementById("map"),
@@ -265,8 +266,8 @@ function on_update() {
let rs_y = rs >> 3
let bs_y = bs >> 3
- ui.red_score.style.left = (SCORE_X0 + SCORE_DX * rs_x) + "px"
- ui.blue_score.style.left = (SCORE_X0 + SCORE_DX * bs_x) + "px"
+ ui.red_score.style.left = (SCORE_X0 + SCORE_DX * rs_x + SCORE_DXDY * rs_y) + "px"
+ ui.blue_score.style.left = (SCORE_X0 + SCORE_DX * bs_x + SCORE_DXDY * bs_y) + "px"
if (rs === bs) {
ui.red_score.style.top = (SCORE_Y0 + SCORE_DY * rs_y - 21) + "px"
ui.blue_score.style.top = (SCORE_Y0 + SCORE_DY * bs_y + 8) + "px"