summaryrefslogtreecommitdiff
path: root/src/animation.h
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2006-07-20 11:41:32 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2006-07-20 11:41:32 +0000
commitab3871e98d7fe2f69f0ab99c066f8c7040014731 (patch)
tree30b0d9b316ca702df73d43675fd240a735da9e6a /src/animation.h
parentb9d581cf5f7c1439f391d3f4906308f9e40d8012 (diff)
downloadmana-client-ab3871e98d7fe2f69f0ab99c066f8c7040014731.tar.gz
mana-client-ab3871e98d7fe2f69f0ab99c066f8c7040014731.tar.bz2
mana-client-ab3871e98d7fe2f69f0ab99c066f8c7040014731.tar.xz
mana-client-ab3871e98d7fe2f69f0ab99c066f8c7040014731.zip
Fixed left bow attack animation, made the attack animation stay in sync with attack speed.
Diffstat (limited to 'src/animation.h')
-rw-r--r--src/animation.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/animation.h b/src/animation.h
index 55f0bc99..7447b7a8 100644
--- a/src/animation.h
+++ b/src/animation.h
@@ -46,14 +46,16 @@ class Animation
public:
Animation();
- void addPhase (int image, unsigned int delay, int offsetX, int offsetY);
+ void addPhase(int image, unsigned int delay, int offsetX, int offsetY);
void update(unsigned int time);
int getCurrentPhase();
- int getOffsetX() { return (*iCurrentPhase).offsetX ; };
- int getOffsetY() { return (*iCurrentPhase).offsetY ; };
+ int getOffsetX() { return (*iCurrentPhase).offsetX; };
+ int getOffsetY() { return (*iCurrentPhase).offsetY; };
+
+ int getLength();
protected:
std::list<AnimationPhase> mAnimationPhases;
@@ -105,6 +107,11 @@ class AnimatedSprite
void play(std::string action);
/**
+ * Plays an action in a specified time.
+ */
+ void play(std::string action, int time);
+
+ /**
* Sets a new action with a new direction.
*/
void play(std::string action, std::string direction);
@@ -155,6 +162,7 @@ class AnimatedSprite
Actions mActions;
std::string mAction, mDirection;
int mLastTime;
+ float mSpeed;
};
#endif