summaryrefslogtreecommitdiff
path: root/src/hitbox.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2018-05-01 11:15:14 +0200
committerJustin Worthe <justin@worthe-it.co.za>2018-05-01 11:15:14 +0200
commit934efcccaa5a82f993c13c91511afe1943caa3b4 (patch)
tree2544ba42a341de7a2b5d45cb74ad6928f0f11258 /src/hitbox.rs
parenta70b7befc08646ea92282fa30b12bae811f22203 (diff)
Added escalating difficulty
Diffstat (limited to 'src/hitbox.rs')
-rw-r--r--src/hitbox.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hitbox.rs b/src/hitbox.rs
index df87b68..04de484 100644
--- a/src/hitbox.rs
+++ b/src/hitbox.rs
@@ -9,6 +9,6 @@ pub trait CircleHitbox {
}
fn touches_circle(&self, other: &CircleHitbox) -> bool {
- self.pos().distance(other.pos()) <= self.radius() + other.radius()
+ self.pos().distance_squared(other.pos()) <= (self.radius() + other.radius()).powi(2)
}
}