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:
Mike 2023-10-16 15:15:32 -07:00 committed by GitHub
parent 490699c311
commit 88599d7fa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();