summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-11-26 14:20:50 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-11-26 14:20:50 +0000
commit7f819e46b584145e2cf2ea742ced9fab0ffc233e (patch)
tree9aa8ee99a4b4dd653917155282e82e6b9a64f718 /src/game.cpp
parentcc86266f4b59420a155df8c1aa01b9ce20b6585d (diff)
downloadmana-7f819e46b584145e2cf2ea742ced9fab0ffc233e.tar.gz
mana-7f819e46b584145e2cf2ea742ced9fab0ffc233e.tar.bz2
mana-7f819e46b584145e2cf2ea742ced9fab0ffc233e.tar.xz
mana-7f819e46b584145e2cf2ea742ced9fab0ffc233e.zip
Made Being::mDirection protected, forcing the use of setDirection. Defaulted
variant argument to 0 since this is the most common situation. Some SpriteDef refactoring, splitting up the loading into several methods, in preparation of adding support for including other sprites.
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 7da80069..6bc37365 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -518,13 +518,13 @@ void Game::handleInput()
if (!item) {
Uint16 x = player_node->mX;
Uint16 y = player_node->mY;
- if (player_node->mDirection & Being::UP)
+ if (player_node->getDirection() & Being::UP)
y--;
- if (player_node->mDirection & Being::DOWN)
+ if (player_node->getDirection() & Being::DOWN)
y++;
- if (player_node->mDirection & Being::LEFT)
+ if (player_node->getDirection() & Being::LEFT)
x--;
- if (player_node->mDirection & Being::RIGHT)
+ if (player_node->getDirection() & Being::RIGHT)
x++;
item = floorItemManager->findByCoordinates(x, y);
@@ -692,13 +692,13 @@ void Game::handleInput()
{
Uint16 targetX = x, targetY = y;
- if (player_node->mDirection & Being::UP)
+ if (player_node->getDirection() & Being::UP)
targetY--;
- if (player_node->mDirection & Being::DOWN)
+ if (player_node->getDirection() & Being::DOWN)
targetY++;
- if (player_node->mDirection & Being::LEFT)
+ if (player_node->getDirection() & Being::LEFT)
targetX--;
- if (player_node->mDirection & Being::RIGHT)
+ if (player_node->getDirection() & Being::RIGHT)
targetX++;
// Attack priorioty is: Monster, Player, auto target