From 430b77be2e8994ace0d1fd37f8198dab310003e3 Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Sun, 27 Jul 2025 09:32:49 -0500 Subject: [PATCH] Fix: add game entities only when in Playing state --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 9b66690..bc782d5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,7 +11,7 @@ pub struct AsteroidPlugin; impl Plugin for AsteroidPlugin { fn build(&self, app: &mut App) { app.add_plugins(title_screen::GameMenuPlugin) - .add_systems(Startup, (spawn_camera, spawn_player, spawn_ui)) + .add_systems(OnEnter(GameState::Playing), (spawn_camera, spawn_player, spawn_ui)) .insert_resource(ClearColor(BACKGROUND_COLOR)) .insert_resource(WorldSize { width: WINDOW_SIZE.x,