changeset 668:140ee7de6d90

Use the correct half-size of the hitbox.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 12 Aug 2019 15:09:53 +0200
parents 904849807fd8
children 1bb8b34dbd32
files src/th06/enemy.rs
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/th06/enemy.rs
+++ b/src/th06/enemy.rs
@@ -245,7 +245,7 @@ impl Enemy {
 
     /// Sets the hitbox around the enemy.
     pub fn set_hitbox(&mut self, width: f32, height: f32) {
-        self.hitbox_half_size = [width, height];
+        self.hitbox_half_size = [width / 2., height / 2.];
     }
 
     /// Run all interpolators and such, and update internal variables once per