Fix: only run space-to-start when on title screen

This commit is contained in:
2025-07-27 10:43:28 -05:00
parent 477460ad2f
commit 39bddf1c9e

View File

@@ -8,7 +8,7 @@ impl Plugin for GameMenuPlugin {
fn build(&self, app: &mut App) {
app.add_systems(OnEnter(GameState::TitleScreen), spawn_menu)
.add_systems(OnExit(GameState::TitleScreen), despawn_menu)
.add_systems(Update, handle_spacebar);
.add_systems(Update, handle_spacebar.run_if(in_state(GameState::TitleScreen)));
}
}