diff --git a/crates/border-wars/src/hex.rs b/crates/border-wars/src/hex.rs index 4cc18ed..79969ad 100644 --- a/crates/border-wars/src/hex.rs +++ b/crates/border-wars/src/hex.rs @@ -35,8 +35,10 @@ pub struct HexPosition { impl HexPosition { /// Returns the distance between two "HexPosition" pub fn distance_to(&self, other: &HexPosition) -> f32 { - - 1. + ((self.q - other.q).abs() + + (self.r - other.r).abs() + + (self.q + self.r - other.q - other.r).abs()) as f32 + / 2. } /// Returns all positions in a given range