diff options
Diffstat (limited to 'src/entities/bug.rs')
-rw-r--r-- | src/entities/bug.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/entities/bug.rs b/src/entities/bug.rs index f64669d..b5e31c7 100644 --- a/src/entities/bug.rs +++ b/src/entities/bug.rs @@ -13,13 +13,10 @@ const SPEED: f64 = 175.; impl Bug { pub fn new(x: f64, y: f64) -> Bug { - let pos = Vec2d { - x: x, - y: y - }; + let pos = Vec2d::new(x, y); let pos_unit = pos.unit(); Bug { - pos: pos, + pos, rotation: (-pos).angle(), velocity: -pos_unit * SPEED, alive: true |