sync balls to align them in slots

This commit is contained in:
nquidox 2026-04-12 17:39:32 +03:00
parent 6423764a17
commit 9bad37d011
2 changed files with 10 additions and 3 deletions

View file

@ -33,7 +33,7 @@ impl Plugin for LevelPlugin {
check_and_remove_matches, check_and_remove_matches,
update_score_text, update_score_text,
move_queue_along_track, move_queue_along_track,
// sync_ball_visuals, sync_ball_visuals,
) )
.chain(), .chain(),
) )

View file

@ -326,12 +326,19 @@ pub fn check_and_remove_matches(
// записываем ласт хит, чтоб имитировать триггер каскадного уничтожения // записываем ласт хит, чтоб имитировать триггер каскадного уничтожения
wave.last_insert_index = Some(removed_min_idx - 1); 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 { } else {
// === РАЗНЫЕ ТИПЫ: НИЧЕГО не делаем === // === РАЗНЫЕ ТИПЫ: НИЧЕГО не делаем ===
// Дыра остаётся, индексы и прогресс не трогаем // Дыра остаётся, индексы и прогресс не трогаем
println!("Different types ({:?} vs {:?}): gap preserved", println!("Different types ({:?} vs {:?}): gap preserved",
left_neighbor_type, right_neighbor_type); 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; return;
} }