Move HUD spawning system into widgets
It actually needs to be completely replaced. When that finally happens, the new bits will live here.
This commit is contained in:
@@ -47,7 +47,7 @@ impl Plugin for AsteroidPlugin {
|
||||
.add_systems(Startup, spawn_camera)
|
||||
.add_systems(
|
||||
OnEnter(GameState::Playing),
|
||||
(objects::spawn_player, spawn_ui),
|
||||
(objects::spawn_player, widgets::spawn_ui),
|
||||
)
|
||||
.add_systems(
|
||||
FixedUpdate,
|
||||
@@ -186,10 +186,3 @@ fn input_ship_shoot(
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
fn spawn_ui(mut commands: Commands, score: Res<Score>, lives: Res<Lives>) {
|
||||
commands.spawn((
|
||||
Text::new(format!("Score: {score:?} | Lives: {lives:?}")),
|
||||
TextFont::from_font_size(25.0),
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user