From da3b52e39516060b6be576d9f4f1574c5eaa012f Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Sun, 25 Apr 2021 13:25:05 -0400 Subject: [PATCH] Add flipper logic --- src/logic/ingame/playerlogic.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/logic/ingame/playerlogic.rs b/src/logic/ingame/playerlogic.rs index a506daa..9ff92ed 100644 --- a/src/logic/ingame/playerlogic.rs +++ b/src/logic/ingame/playerlogic.rs @@ -147,6 +147,13 @@ pub fn update_player_movement( // Only do this if the mouse is far enough away let player_stunned = game_core.player.stun_timer > 0.0; let mut player_real_movement = game_core.player.direction * speed_multiplier; + + // Handle the player wearing flippers + if game_core.player.inventory.flippers.is_some() { + player_real_movement *= game_core.player.inventory.flippers.as_ref().unwrap().speed_increase; + } + + // Handle movement and collisions if raw_movement_direction.distance_to(Vector2::zero()) > game_core.player.size.y / 2.0 && !game_core.player.is_stunned() {