Skip to content

Commit

Permalink
Use chain in breakout example (bevyengine#10124)
Browse files Browse the repository at this point in the history
# 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`
  • Loading branch information
hymm authored and Ray Redondo committed Jan 9, 2024
1 parent b400116 commit 121693a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/games/breakout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 121693a

Please sign in to comment.