diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-08-27 19:05:07 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-08-27 19:05:07 +0000 |
commit | 6f6d061b23c6c70c632fb3ec6aa3735325f701e0 (patch) | |
tree | a0d57853d826ebca0abe9ec86973c64bec688427 /src/being.h | |
parent | a544d1b3bf1d133d5877aa97d59d7128555e69fc (diff) | |
download | mana-6f6d061b23c6c70c632fb3ec6aa3735325f701e0.tar.gz mana-6f6d061b23c6c70c632fb3ec6aa3735325f701e0.tar.bz2 mana-6f6d061b23c6c70c632fb3ec6aa3735325f701e0.tar.xz mana-6f6d061b23c6c70c632fb3ec6aa3735325f701e0.zip |
Implemented pixel-grained movements.
Diffstat (limited to 'src/being.h')
-rw-r--r-- | src/being.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/being.h b/src/being.h index 38c62dbb..7c08ab81 100644 --- a/src/being.h +++ b/src/being.h @@ -324,13 +324,13 @@ class Being : public Sprite * Get the current X pixel offset. */ int - getXOffset() const { return getOffset(LEFT, RIGHT); } + getXOffset() const { return getOffset(mStepX); } /** * Get the current Y pixel offset. */ int - getYOffset() const { return getOffset(UP, DOWN); } + getYOffset() const { return getOffset(mStepY); } std::auto_ptr<Equipment> mEquipment; int mVisibleEquipment[6]; /**< Visible equipments */ @@ -343,12 +343,6 @@ class Being : public Sprite setPath(const Path &path); /** - * Calculates the offset in the given directions. - * If walking in direction 'neg' the value is negated. - */ - int getOffset(char pos, char neg) const; - - /** * Returns the sprite direction of this being. */ SpriteDirection @@ -371,6 +365,11 @@ class Being : public Sprite Sint32 mPx, mPy; /**< Pixel coordinates */ std::vector<AnimatedSprite*> mSprites; + + private: + Sint16 mStepX, mStepY; + Uint16 mStepTime; + int getOffset(int) const; }; #endif |