diff options
-rw-r--r-- | engine/player.cpp | 11 | ||||
m--------- | wriggle | 0 |
2 files changed, 6 insertions, 5 deletions
diff --git a/engine/player.cpp b/engine/player.cpp index 94b5074..70f7c1f 100644 --- a/engine/player.cpp +++ b/engine/player.cpp @@ -1,4 +1,5 @@ -#include <SFML/Window.hpp> +#include <wriggle/input.h> +#include <wriggle/gl.h> #include <cmath> #include "player.h" @@ -27,12 +28,12 @@ void Player::draw() { } void Player::update() { - sf::Input input; + Input input; - float factor = move_factor * (input.IsKeyDown(sf::Key::LShift) ? focus_factor : 1); + float factor = move_factor * (input.key_pressed(Key::LShift) ? focus_factor : 1); - float x_speed = factor * input.IsKeyDown(sf::Key::Right) - factor * input.IsKeyDown(sf::Key::Left); - float y_speed = factor * input.IsKeyDown(sf::Key::Up) - factor * input.IsKeyDown(sf::Key::Down); + float x_speed = factor * input.key_pressed(Key::Right) - factor * input.key_pressed(Key::Left); + float y_speed = factor * input.key_pressed(Key::Up) - factor * input.key_pressed(Key::Down); if(x_speed && y_speed) { x_speed /= sqrtf(2); diff --git a/wriggle b/wriggle -Subproject f88411abc7150ed209efcb6180503f0c6f7c8ef +Subproject 7ebb0e91f63203753420b5a4b75d09d170f204f |