Begin work on event-based asteroid spawning

The events are being emitted by the spawn manager, and consumed by the
spawn_asteroid system. Now to wire in the spawn properties, and then
make a good spawning manager.
This commit is contained in:
2025-07-29 13:12:22 -05:00
parent 911b6c5fe7
commit 2c43bc699e
2 changed files with 30 additions and 11 deletions

View File

@@ -39,6 +39,7 @@ impl Plugin for AsteroidPlugin {
input_ship_rotation,
wrap_entities,
asteroids::tick_asteroid_manager,
asteroids::spawn_asteroid.after(asteroids::tick_asteroid_manager),
)
.run_if(in_state(GameState::Playing)),
)
@@ -46,7 +47,8 @@ impl Plugin for AsteroidPlugin {
FixedPostUpdate,
(integrate_velocity, update_positions, apply_rotation_to_mesh)
.run_if(in_state(GameState::Playing)),
);
)
.add_event::<asteroids::SpawnAsteroid>();
app.insert_state(GameState::TitleScreen);
}
}