[Add] Added arrow key movement, for those less capable of using wasd.

This commit is contained in:
Rtch90 2012-04-12 19:18:29 +01:00
parent 1997e82ee1
commit b2731c4cf5

View File

@ -33,19 +33,19 @@ void Player::Render(void) {
void Player::ProcessEvents(void) { void Player::ProcessEvents(void) {
float oldX = x = _player->GetX(); float oldX = x = _player->GetX();
float oldY = y = _player->GetY(); float oldY = y = _player->GetY();
if(KeyStillDown(SDLK_w)) { if(KeyStillDown(SDLK_w) || KeyStillDown(SDLK_UP)) {
y -= PLAYER_SPEED; y -= PLAYER_SPEED;
_player->SetY(y); _player->SetY(y);
} }
if(KeyStillDown(SDLK_s)) { if(KeyStillDown(SDLK_s) || KeyStillDown(SDLK_DOWN)) {
y += PLAYER_SPEED; y += PLAYER_SPEED;
_player->SetY(y); _player->SetY(y);
} }
if(KeyStillDown(SDLK_a)) { if(KeyStillDown(SDLK_a) || KeyStillDown(SDLK_LEFT)) {
x -= PLAYER_SPEED; x -= PLAYER_SPEED;
_player->SetX(x); _player->SetX(x);
} }
if(KeyStillDown(SDLK_d)) { if(KeyStillDown(SDLK_d) || KeyStillDown(SDLK_RIGHT)) {
x += PLAYER_SPEED; x += PLAYER_SPEED;
_player->SetX(x); _player->SetX(x);
} }