[Add] You can run with shift now.

This commit is contained in:
Rtch90 2012-04-12 22:32:38 +01:00
parent 2c155b7ec1
commit 6dcc65e9c9

View File

@ -4,7 +4,7 @@
#include "../Sound/SoundEffect.h" #include "../Sound/SoundEffect.h"
Player::Player(void) { Player::Player(void) {
PLAYER_SPEED = 15; PLAYER_SPEED = 5;
_rotationAngle = 0.0f; _rotationAngle = 0.0f;
_player = new Sprite(); _player = new Sprite();
_player->LoadSprite("../Data/Img/Player.png"); _player->LoadSprite("../Data/Img/Player.png");
@ -55,6 +55,15 @@ void Player::ProcessEvents(void) {
x += PLAYER_SPEED; x += PLAYER_SPEED;
_player->SetX(x); _player->SetX(x);
} }
if(KeyDown(SDLK_LSHIFT)) {
// Run!
PLAYER_SPEED += 3;
Debug::logger->message("Speed: %f", PLAYER_SPEED);
}
if(KeyUp(SDLK_LSHIFT)) {
PLAYER_SPEED -= 2;
Debug::logger->message("Speed: %f", PLAYER_SPEED);
}
if(x != oldX || y != oldY) { if(x != oldX || y != oldY) {
if(!SoundEffect::IsPlaying(1)) { if(!SoundEffect::IsPlaying(1)) {
int sfxIndex; int sfxIndex;