[Add] You can run with shift now.
This commit is contained in:
parent
2c155b7ec1
commit
6dcc65e9c9
@ -4,7 +4,7 @@
|
||||
#include "../Sound/SoundEffect.h"
|
||||
|
||||
Player::Player(void) {
|
||||
PLAYER_SPEED = 15;
|
||||
PLAYER_SPEED = 5;
|
||||
_rotationAngle = 0.0f;
|
||||
_player = new Sprite();
|
||||
_player->LoadSprite("../Data/Img/Player.png");
|
||||
@ -55,6 +55,15 @@ void Player::ProcessEvents(void) {
|
||||
x += PLAYER_SPEED;
|
||||
_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(!SoundEffect::IsPlaying(1)) {
|
||||
int sfxIndex;
|
||||
|
Loading…
Reference in New Issue
Block a user