summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-27 11:21:10 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-27 11:21:10 +0000
commitd3cba1c4beac4a1c98f38bbca076a98f9c90bbc4 (patch)
treee7d1ea0a7575d0dd28802e7dfe2a322e818729fc /src/being.cpp
parent5980dba7ace73e6587b9966bc2076ad2b2eaa5f0 (diff)
downloadmana-client-d3cba1c4beac4a1c98f38bbca076a98f9c90bbc4.tar.gz
mana-client-d3cba1c4beac4a1c98f38bbca076a98f9c90bbc4.tar.bz2
mana-client-d3cba1c4beac4a1c98f38bbca076a98f9c90bbc4.tar.xz
mana-client-d3cba1c4beac4a1c98f38bbca076a98f9c90bbc4.zip
Changed to pixel-based coordinates for beings.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 87332c7a..b49f790e 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -79,7 +79,7 @@ Being::setDestination(Uint16 destX, Uint16 destY)
{
if (mMap)
{
- setPath(mMap->findPath(mX, mY, destX, destY));
+ setPath(mMap->findPath(mX / 32, mY / 32, destX / 32, destY / 32));
}
}
@@ -265,19 +265,19 @@ Being::nextStep()
mPath.pop_front();
int dir = 0;
- if (node.x > mX)
+ if (node.x > mX / 32)
dir |= RIGHT;
- else if (node.x < mX)
+ else if (node.x < mX / 32)
dir |= LEFT;
- if (node.y > mY)
+ if (node.y > mY / 32)
dir |= DOWN;
- else if (node.y < mY)
+ else if (node.y < mY / 32)
dir |= UP;
setDirection(dir);
- mX = node.x;
- mY = node.y;
+ mX = node.x * 32 + 16;
+ mY = node.y * 32 + 16;
setAction(WALK);
mWalkTime += mWalkSpeed / 10;
}
@@ -298,8 +298,8 @@ Being::logic()
}
// Update pixel coordinates
- mPx = mX * 32 + getXOffset();
- mPy = mY * 32 + getYOffset();
+ mPx = mX - 16 + getXOffset();
+ mPy = mY - 16 + getYOffset();
if (mEmotion != 0)
{