From b2731c4cf5b7994b173db05f8f92dcff6fe988ef Mon Sep 17 00:00:00 2001 From: Rtch90 Date: Thu, 12 Apr 2012 19:18:29 +0100 Subject: [PATCH] [Add] Added arrow key movement, for those less capable of using wasd. --- src/Actor/Player.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Actor/Player.cpp b/src/Actor/Player.cpp index be9e269..e4692be 100644 --- a/src/Actor/Player.cpp +++ b/src/Actor/Player.cpp @@ -33,19 +33,19 @@ void Player::Render(void) { void Player::ProcessEvents(void) { float oldX = x = _player->GetX(); float oldY = y = _player->GetY(); - if(KeyStillDown(SDLK_w)) { + if(KeyStillDown(SDLK_w) || KeyStillDown(SDLK_UP)) { y -= PLAYER_SPEED; _player->SetY(y); } - if(KeyStillDown(SDLK_s)) { + if(KeyStillDown(SDLK_s) || KeyStillDown(SDLK_DOWN)) { y += PLAYER_SPEED; _player->SetY(y); } - if(KeyStillDown(SDLK_a)) { + if(KeyStillDown(SDLK_a) || KeyStillDown(SDLK_LEFT)) { x -= PLAYER_SPEED; _player->SetX(x); } - if(KeyStillDown(SDLK_d)) { + if(KeyStillDown(SDLK_d) || KeyStillDown(SDLK_RIGHT)) { x += PLAYER_SPEED; _player->SetX(x); }