diff --git a/src/widgets.rs b/src/widgets.rs index d7fa640..f5fe460 100644 --- a/src/widgets.rs +++ b/src/widgets.rs @@ -52,6 +52,11 @@ impl Plugin for PluginGameOver { } } +// Marker component for the title screen UI entity. +// This way, a query for the TitleUI can be used to despawn the title screen +#[derive(Component)] +struct TitleUI; + /// Marker component for things on the get-ready indicator #[derive(Component)] struct OnReadySetGo; @@ -90,6 +95,27 @@ fn despawn(mut commands: Commands, to_despawn: Query>, mut game_state: ResMut>) { if input.just_pressed(KeyCode::Space) { game_state.set(GameState::GetReady);