2024-03-16 14:00:31 +00:00
|
|
|
use bevy::prelude::*;
|
|
|
|
|
2024-03-16 13:27:22 +00:00
|
|
|
fn main() {
|
2024-03-16 14:00:31 +00:00
|
|
|
App::new()
|
2024-03-16 15:12:35 +00:00
|
|
|
.add_systems(Update, handle_input)
|
|
|
|
.add_plugins((DefaultPlugins, ))
|
2024-03-16 14:00:31 +00:00
|
|
|
.run();
|
|
|
|
}
|
|
|
|
|
2024-03-16 15:12:35 +00:00
|
|
|
fn handle_input(
|
|
|
|
keyboard_input: Res<ButtonInput<KeyCode>>,
|
|
|
|
mut app_exit_events: ResMut<Events<bevy::app::AppExit>>
|
|
|
|
) {
|
|
|
|
if keyboard_input.pressed(KeyCode::KeyQ) {
|
|
|
|
app_exit_events.send(bevy::app::AppExit);
|
2024-03-16 14:13:00 +00:00
|
|
|
}
|
|
|
|
}
|