diff options
Diffstat (limited to 'src/animation.h')
-rw-r--r-- | src/animation.h | 14 |
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 |