summaryrefslogtreecommitdiff
path: root/src/entities/bug.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2018-09-12 21:39:34 +0200
committerJustin Worthe <justin@worthe-it.co.za>2018-09-12 21:39:34 +0200
commit38caea2a14bb3c205e4c42daa9f11f0f60550360 (patch)
treec73226397a8334418280ce09fa7caf96c4ae6db8 /src/entities/bug.rs
parent57f412d73a151f7a4fa35feaf249808dcbe5b5dc (diff)
Changed hitboxed from an 'is a hitbox' to a 'has a hitbox'
Diffstat (limited to 'src/entities/bug.rs')
-rw-r--r--src/entities/bug.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/entities/bug.rs b/src/entities/bug.rs
index b5e31c7..b299305 100644
--- a/src/entities/bug.rs
+++ b/src/entities/bug.rs
@@ -26,13 +26,10 @@ impl Bug {
pub fn advance(&mut self, seconds: f64) {
self.pos = self.pos + self.velocity * seconds;
}
-}
-impl CircleHitbox for Bug {
- fn pos(&self) -> Vec2d {
- self.pos
- }
- fn radius(&self) -> f64 {
- 75.
+ pub fn hitbox(&self) -> Hitbox {
+ Hitbox::Circle(CircleHitbox{
+ pos: self.pos, radius: 75.
+ })
}
}