summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-10-05 08:34:57 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-10-05 08:34:57 +0200
commit8b7e2d4123805ac634352af7adc93e89fde285e4 (patch)
tree0107867d867c27ec54d42f136b394a7ed2712cf8 /engine
parenta24cc110acebb3fc1b40a38d08f737bf09b15e54 (diff)
Using wriggle/input.sfml
Diffstat (limited to 'engine')
-rw-r--r--engine/player.cpp11
1 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);