show range indicator when placing tower, cleanup tower info stats

This commit is contained in:
Jim 2025-09-01 21:37:18 -04:00
parent e6b04bbdd1
commit 3a25a1bd87
Signed by: jim
GPG key ID: 3D7D94BA53088BF4
9 changed files with 106 additions and 49 deletions

View file

@ -69,8 +69,8 @@ pub struct Died {
pub slayer: Option<Entity>,
}
#[derive(Component, Clone, Debug, Reflect)]
#[require(InvulnerabilityTime)]
#[derive(Component, Clone, Copy, Debug, Reflect)]
#[require(InvulnerabilityTime, Defense)]
pub struct Health {
pub max: f32,
pub current: f32,
@ -127,8 +127,7 @@ impl From<&InvulnerabilityTime> for Invulnerable {
}
}
#[derive(Component, Clone, Debug, Default)]
#[require(Health)]
#[derive(Component, Clone, Copy, Debug, Default)]
pub struct Defense {
pub amount: f32,
}
@ -254,7 +253,7 @@ fn tick_invulnerability(
}
}
#[derive(Component, Deref, DerefMut)]
#[derive(Component, Deref, DerefMut, Clone, Copy)]
pub struct Range(pub f32);
impl Range {