From 38caea2a14bb3c205e4c42daa9f11f0f60550360 Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Wed, 12 Sep 2018 21:39:34 +0200 Subject: Changed hitboxed from an 'is a hitbox' to a 'has a hitbox' --- src/entities/bug.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/entities/bug.rs') 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. + }) } } -- cgit v1.2.3