moved critical systems to fixed update schedule

This commit is contained in:
nquidox 2026-04-18 21:55:27 +03:00
parent f502cdb0ce
commit eeebdbd272

View file

@ -13,13 +13,18 @@ pub enum LinearUpdateSet {
impl Plugin for LinearPlayPlugin {
fn build(&self, app: &mut App) {
app
.add_systems(OnEnter(LinearPlayState), (setup, spawn_linear_cannon).chain())
app.add_systems(
OnEnter(LinearPlayState),
(setup, spawn_linear_cannon).chain(),
)
.add_systems(OnEnter(LinearGameRestart), linear_restart)
.add_plugins(LinearUIPlugin)
.configure_sets(
Update,
LinearUpdateSet::Track.run_if(in_state(LinearPlayState)),
).configure_sets(
FixedUpdate,
LinearUpdateSet::Track.run_if(in_state(LinearPlayState)),
)
.add_systems(
Update,
@ -29,16 +34,20 @@ impl Plugin for LinearPlayPlugin {
draw_grid,
// draw_cannon_laser,
//несколько систем с соблюдением порядка
calculate_projectile_hits,
linear_move_projectiles,
cycle_cannon_balls,
update_linear_cannon_preview,
spawn_projectile_from_cannon,
rotate_linear_cannon,
).in_set(LinearUpdateSet::Track),
)
.add_systems(
FixedUpdate,
(
spawn_round_ball,
move_round_balls,
rotate_linear_cannon,
)
.in_set(LinearUpdateSet::Track),
calculate_projectile_hits,
linear_move_projectiles,
).in_set(LinearUpdateSet::Track),
)
.add_systems(OnExit(LinearPlayState), cleanup);
}