From 160a1afd7e7cfaeb88e44abf6b088b78c61b35ac Mon Sep 17 00:00:00 2001 From: Maximilian Giller Date: Wed, 10 May 2023 11:29:50 +0200 Subject: [PATCH] Normalizing direction vector --- src/game/input/direction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/input/direction.cpp b/src/game/input/direction.cpp index 09cec27..c23ce52 100644 --- a/src/game/input/direction.cpp +++ b/src/game/input/direction.cpp @@ -1,5 +1,6 @@ #include #include "direction.h" +#include "../../utilities/vector_utils.hpp" InputDirection Direction::getDirection(sf::Keyboard::Key key) { @@ -46,5 +47,5 @@ sf::Vector2f Direction::getVector(InputDirection direction) vector.x += 1; } - return vector; + return normalize(vector); }