From 8b7e2d4123805ac634352af7adc93e89fde285e4 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Tue, 5 Oct 2010 08:34:57 +0200 Subject: Using wriggle/input. --- engine/player.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'engine') 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 +#include +#include #include #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); -- cgit v1.2.3