Skip to content

Commit cdae95b

Browse files
author
giusdp
committed
Add exit_on_esc_system to examples with window (#2121)
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.
1 parent 739224f commit cdae95b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

examples/game/alien_cake_addict.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ fn main() {
4040
.with_run_criteria(FixedTimestep::step(5.0))
4141
.with_system(spawn_bonus.system()),
4242
)
43+
.add_system(bevy::input::system::exit_on_esc_system.system())
4344
.run();
4445
}
4546

examples/game/breakout.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ fn main() {
2121
.with_system(ball_movement_system.system()),
2222
)
2323
.add_system(scoreboard_system.system())
24+
.add_system(bevy::input::system::exit_on_esc_system.system())
2425
.run();
2526
}
2627

0 commit comments

Comments
 (0)