Implement the HUD for real

Now it works!... but it runs every single frame, probably causing a
bunch of unnecessary text rendering and UI layout operations. I'll have
to come back and make it event-based at some point.
This commit is contained in:
2025-08-14 13:07:25 -05:00
parent 9d9b25d1df
commit 40ee042b53
2 changed files with 63 additions and 6 deletions

View File

@@ -37,6 +37,7 @@ impl Plugin for AsteroidPlugin {
widgets::PluginGameMenu,
widgets::PluginGameOver,
widgets::PluginGetReady,
widgets::PluginGameHud,
RapierPhysicsPlugin::<NoUserData>::pixels_per_meter(10.0),
RapierDebugRenderPlugin::default(),
))
@@ -48,10 +49,7 @@ impl Plugin for AsteroidPlugin {
.insert_resource(AsteroidSpawner::new())
.init_resource::<GameAssets>()
.add_systems(Startup, spawn_camera)
.add_systems(
OnEnter(GameState::Playing),
(objects::spawn_player, widgets::spawn_ui),
)
.add_systems(OnEnter(GameState::Playing), objects::spawn_player)
.add_systems(
FixedUpdate,
(