diff options
Diffstat (limited to 'src/player.cpp')
-rw-r--r-- | src/player.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/player.cpp b/src/player.cpp index 71bb6ca5..d6363242 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -85,7 +85,6 @@ Being::Type Player::getType() const void Player::draw(Graphics *graphics, int offsetX, int offsetY) { - unsigned char dir = direction / 2; int px = mPx + offsetX; int py = mPy + offsetY; int frame = action; @@ -102,6 +101,9 @@ void Player::draw(Graphics *graphics, int offsetX, int offsetY) frame += 4 * (getWeapon() - 1); } + unsigned char dir = 0; + while (!(direction & (1 << dir))) dir++; + graphics->drawImage(playerset->spriteset[frame + 16 * dir], px - 16, py - 32); |