From 88599d7fa06dff6bba434f3a91b57bf8f483f158 Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 16 Oct 2023 15:15:32 -0700 Subject: [PATCH] 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` --- examples/games/breakout.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/games/breakout.rs b/examples/games/breakout.rs index 233eaee48a..3577fc01c1 100644 --- a/examples/games/breakout.rs +++ b/examples/games/breakout.rs @@ -59,13 +59,13 @@ fn main() { .add_systems( FixedUpdate, ( + apply_velocity, + move_paddle, check_for_collisions, - apply_velocity.before(check_for_collisions), - move_paddle - .before(check_for_collisions) - .after(apply_velocity), - play_collision_sound.after(check_for_collisions), - ), + play_collision_sound, + ) + // `chain`ing systems together runs them in order + .chain(), ) .add_systems(Update, (update_scoreboard, bevy::window::close_on_esc)) .run();