disable resource collection outside of core range, disable purchase buttons if too much money

This commit is contained in:
Jim 2025-09-01 21:09:37 -04:00
parent 6a4978041c
commit e6b04bbdd1
Signed by: jim
GPG key ID: 3D7D94BA53088BF4
8 changed files with 97 additions and 56 deletions

View file

@ -257,6 +257,12 @@ fn tick_invulnerability(
#[derive(Component, Deref, DerefMut)]
pub struct Range(pub f32);
impl Range {
pub fn within(&self, a: Vec3, b: Vec3) -> bool {
a.distance_squared(b) < self.0 * self.0
}
}
impl Default for Range {
fn default() -> Self {
Self(5.)