Mercurial > touhou
diff src/th06/enemy.rs @ 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 | 082c39d7d1c3 |
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