Normalizing direction vector

This commit is contained in:
Maximilian Giller 2023-05-10 11:29:50 +02:00
parent 84c7e9e3b3
commit 160a1afd7e

View file

@ -1,5 +1,6 @@
#include <map>
#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);
}