Skip to content

Commit

Permalink
Add exit_on_esc_system to examples with window (#2121)
Browse files Browse the repository at this point in the history
This covers issue #2110

It adds the line `.add_system(bevy::input::system::exit_on_esc_system.system())` before `.run()`
to every example that uses a window, so users have a quick way to close the examples.

I used the full name `bevy::input::system::exit_on_esc_system`, I thought it gave clarity about being a built-in system.

The examples excluded from the change are the ones in the android, ios, wasm folders, the headless 
examples and the ecs/system_sets example because it closes itself.
  • Loading branch information
giusdp committed May 14, 2021
1 parent 739224f commit cdae95b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/game/alien_cake_addict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ fn main() {
.with_run_criteria(FixedTimestep::step(5.0))
.with_system(spawn_bonus.system()),
)
.add_system(bevy::input::system::exit_on_esc_system.system())
.run();
}

Expand Down
1 change: 1 addition & 0 deletions examples/game/breakout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fn main() {
.with_system(ball_movement_system.system()),
)
.add_system(scoreboard_system.system())
.add_system(bevy::input::system::exit_on_esc_system.system())
.run();
}

Expand Down

0 comments on commit cdae95b

Please sign in to comment.