Use chain in breakout example (#10124)
# Objective - We should encourage of the simpler to reason about chain. ## Solution - Use it in the breakout example --- ## Changelog - Switch breakout to use `chain` instead of `before` and `after`
This commit is contained in:
parent
490699c311
commit
88599d7fa0
@ -59,13 +59,13 @@ fn main() {
|
|||||||
.add_systems(
|
.add_systems(
|
||||||
FixedUpdate,
|
FixedUpdate,
|
||||||
(
|
(
|
||||||
|
apply_velocity,
|
||||||
|
move_paddle,
|
||||||
check_for_collisions,
|
check_for_collisions,
|
||||||
apply_velocity.before(check_for_collisions),
|
play_collision_sound,
|
||||||
move_paddle
|
)
|
||||||
.before(check_for_collisions)
|
// `chain`ing systems together runs them in order
|
||||||
.after(apply_velocity),
|
.chain(),
|
||||||
play_collision_sound.after(check_for_collisions),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.add_systems(Update, (update_scoreboard, bevy::window::close_on_esc))
|
.add_systems(Update, (update_scoreboard, bevy::window::close_on_esc))
|
||||||
.run();
|
.run();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user