From fcaf699542d993bf9f04645e3bc92ff4e30f53b3 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 13 May 2023 23:57:55 +0200 Subject: Momentum cleanup and manual cube shuffling from momentum tracks. --- play.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index e2bf241..4dcf283 100644 --- a/play.js +++ b/play.js @@ -502,17 +502,24 @@ function on_update() { for (let i = 0; i < space_names.length; ++i) layout[i] = [] + for (let i = 0; i < 36; ++i) { if (view.pieces[i] >= 0) { layout[view.pieces[i]].push(ui.cubes[i]) ui.cubes[i].classList.remove("hide") - ui.cubes[i].classList.toggle("action", is_piece_action(i)) - ui.cubes[i].classList.toggle("selected", i === view.selected_cube) - } - else { + } else if (i >= 18) { ui.cubes[i].classList.add("hide") } + ui.cubes[i].classList.toggle("action", is_piece_action(i)) + ui.cubes[i].classList.toggle("selected", i === view.selected_cube) } + + let red_out_of_play = [] + for (let i = 0; i <= 17; ++i) + if (view.pieces[i] < 0) + red_out_of_play.push(ui.cubes[i]) + layout_cubes(red_out_of_play, 1225, 225) + for (let i = 0; i < space_count; ++i) { layout_cubes(layout[i], space_layout_cube[i].x, space_layout_cube[i].y) ui.spaces[i].classList.toggle("action", is_space_action(i)) -- cgit v1.2.3