diff --git a/src/lib.rs b/src/lib.rs index 3eb4faa..68fb4cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,6 +58,7 @@ impl Plugin for AsteroidPlugin { collision_listener, // TODO: Remove debug printing debug_collision_event_printer, + tick_lifetimes, ) .run_if(in_state(GameState::Playing)), ) @@ -163,6 +164,9 @@ impl From for String { } } +#[derive(Component)] +struct Lifetime(Timer); + #[derive(InspectorOptions, Reflect, Resource, Debug, Deref, Clone, Copy)] #[reflect(Resource, InspectorOptions)] struct Lives(i32); @@ -346,3 +350,12 @@ fn spawn_ui(mut commands: Commands, score: Res, lives: Res) { TextFont::from_font_size(25.0), )); } + +fn tick_lifetimes(mut commands: Commands, time: Res