From 9bad37d011c0d1e178afa8194692bc038db48cb0 Mon Sep 17 00:00:00 2001 From: nquidox Date: Sun, 12 Apr 2026 17:39:32 +0300 Subject: [PATCH] sync balls to align them in slots --- src/states/level/plugin.rs | 2 +- src/states/level/system_ball.rs | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/states/level/plugin.rs b/src/states/level/plugin.rs index 6460f57..149c0e6 100644 --- a/src/states/level/plugin.rs +++ b/src/states/level/plugin.rs @@ -33,7 +33,7 @@ impl Plugin for LevelPlugin { check_and_remove_matches, update_score_text, move_queue_along_track, - // sync_ball_visuals, + sync_ball_visuals, ) .chain(), ) diff --git a/src/states/level/system_ball.rs b/src/states/level/system_ball.rs index dddd807..28a42f9 100644 --- a/src/states/level/system_ball.rs +++ b/src/states/level/system_ball.rs @@ -326,12 +326,19 @@ pub fn check_and_remove_matches( // записываем ласт хит, чтоб имитировать триггер каскадного уничтожения wave.last_insert_index = Some(removed_min_idx - 1); - println!(" → Cascade armed at idx {}", removed_min_idx - 1); + println!("Cascade armed at idx {}", removed_min_idx - 1); } else { // === РАЗНЫЕ ТИПЫ: НИЧЕГО не делаем === // Дыра остаётся, индексы и прогресс не трогаем - println!(" → Different types ({:?} vs {:?}): gap preserved", + println!("Different types ({:?} vs {:?}): gap preserved", left_neighbor_type, right_neighbor_type); + + // Сбрасываем прогресс только у шариков ПРАВЕЕ удалённой группы (оторванный хвост) + for (entity, mut ball) in balls.p1().iter_mut() { + if ball.slot_index > removed_max_idx { + ball.slot_progress = 0.0; + } + } } return; }