summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-12 17:17:53 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-12 17:17:53 +0300
commit81f319af0c6321474282de8928378366bbb6e44d (patch)
tree7250047bc275bd3ad399d28cfe954a48bafbd92a /src/game.cpp
parentdb6b712e4169d80f8f2c84a0efbc553d2058c191 (diff)
downloadplus-81f319af0c6321474282de8928378366bbb6e44d.tar.gz
plus-81f319af0c6321474282de8928378366bbb6e44d.tar.bz2
plus-81f319af0c6321474282de8928378366bbb6e44d.tar.xz
plus-81f319af0c6321474282de8928378366bbb6e44d.zip
Move being directions into separate file.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 462479bea..f9f5305ae 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -865,14 +865,14 @@ void Game::handleMove()
if (inputManager.isActionActive(Input::KEY_MOVE_UP) ||
(joystick && joystick->isUp()))
{
- direction |= Being::UP;
+ direction |= BeingDirection::UP;
setValidSpeed();
player_node->cancelFollow();
}
else if (inputManager.isActionActive(Input::KEY_MOVE_DOWN) ||
(joystick && joystick->isDown()))
{
- direction |= Being::DOWN;
+ direction |= BeingDirection::DOWN;
setValidSpeed();
player_node->cancelFollow();
}
@@ -880,14 +880,14 @@ void Game::handleMove()
if (inputManager.isActionActive(Input::KEY_MOVE_LEFT) ||
(joystick && joystick->isLeft()))
{
- direction |= Being::LEFT;
+ direction |= BeingDirection::LEFT;
setValidSpeed();
player_node->cancelFollow();
}
else if (inputManager.isActionActive(Input::KEY_MOVE_RIGHT) ||
(joystick && joystick->isRight()))
{
- direction |= Being::RIGHT;
+ direction |= BeingDirection::RIGHT;
setValidSpeed();
player_node->cancelFollow();
}
@@ -917,14 +917,14 @@ void Game::moveInDirection(const unsigned char direction)
{
int dx = 0;
int dy = 0;
- if (direction & Being::LEFT)
+ if (direction & BeingDirection::LEFT)
dx = -5;
- else if (direction & Being::RIGHT)
+ else if (direction & BeingDirection::RIGHT)
dx = 5;
- if (direction & Being::UP)
+ if (direction & BeingDirection::UP)
dy = -5;
- else if (direction & Being::DOWN)
+ else if (direction & BeingDirection::DOWN)
dy = 5;
viewport->moveCamera(dx, dy);
}