Fix: add game entities only when in Playing state

This commit is contained in:
2025-07-27 09:32:49 -05:00
parent 6eb69f476f
commit 430b77be2e

View File

@@ -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,