summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-11-19 21:24:36 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-11-19 21:24:36 +0000
commit7ac7d0e030464f744546b4e6183a7242f640d5d3 (patch)
treef19831b29511d46e8aba45ace6017c8e6afe815b /src/game.cpp
parentb7cfcffd7a156e19dfa9882d67426f4fa6edef57 (diff)
downloadmana-client-7ac7d0e030464f744546b4e6183a7242f640d5d3.tar.gz
mana-client-7ac7d0e030464f744546b4e6183a7242f640d5d3.tar.bz2
mana-client-7ac7d0e030464f744546b4e6183a7242f640d5d3.tar.xz
mana-client-7ac7d0e030464f744546b4e6183a7242f640d5d3.zip
Separated sprite definition from playback.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/game.cpp b/src/game.cpp
index ba65298f..7da80069 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -86,7 +86,7 @@ bool done = false;
volatile int tick_time;
volatile int fps = 0, frame = 0;
Engine *engine = NULL;
-Joystick *joystick;
+Joystick *joystick = NULL;
extern Window *weightNotice;
extern Window *deathNotice;
@@ -650,35 +650,35 @@ void Game::handleInput()
{
Uint16 x = player_node->mX;
Uint16 y = player_node->mY;
- unsigned char Direction = 0;
+ unsigned char direction = 0;
// Translate pressed keys to movement and direction
if (keys[SDLK_UP] || keys[SDLK_KP8] ||
keys[SDLK_KP7] || keys[SDLK_KP9] ||
joystick && joystick->isUp())
{
- Direction |= Being::UP;
+ direction |= Being::UP;
}
else if (keys[SDLK_DOWN] || keys[SDLK_KP2] ||
keys[SDLK_KP1] || keys[SDLK_KP3] ||
joystick && joystick->isDown())
{
- Direction |= Being::DOWN;
+ direction |= Being::DOWN;
}
if (keys[SDLK_LEFT] || keys[SDLK_KP4] ||
keys[SDLK_KP1] || keys[SDLK_KP7] ||
joystick && joystick->isLeft())
{
- Direction |= Being::LEFT;
+ direction |= Being::LEFT;
}
else if (keys[SDLK_RIGHT] || keys[SDLK_KP6] ||
keys[SDLK_KP3] || keys[SDLK_KP9] ||
joystick && joystick->isRight())
{
- Direction |= Being::RIGHT;
+ direction |= Being::RIGHT;
}
- player_node->walk(Direction);
+ player_node->walk(direction);
// Attacking monsters
if (keys[SDLK_LCTRL] || keys[SDLK_RCTRL] ||