diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-04-13 03:36:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-04-13 03:36:00 +0300 |
commit | c978b7f0d9de1bb6bd84cd299ed80c27c5147927 (patch) | |
tree | 8f1edc2be0816693761ba58aa7c7c554040a7db6 /src/resources/animation.h | |
parent | da1b2d8311ca78eccd3e9875598562ce6bf05cab (diff) | |
download | mv-c978b7f0d9de1bb6bd84cd299ed80c27c5147927.tar.gz mv-c978b7f0d9de1bb6bd84cd299ed80c27c5147927.tar.bz2 mv-c978b7f0d9de1bb6bd84cd299ed80c27c5147927.tar.xz mv-c978b7f0d9de1bb6bd84cd299ed80c27c5147927.zip |
Impliment new tags in sprites animations and random condition.
Tags: <label>, <goto>
Diffstat (limited to 'src/resources/animation.h')
-rw-r--r-- | src/resources/animation.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/resources/animation.h b/src/resources/animation.h index 5130bc8dd..0c6f45681 100644 --- a/src/resources/animation.h +++ b/src/resources/animation.h @@ -39,12 +39,14 @@ struct Frame { ANIMATION = 0, JUMP, + GOTO, LABEL }; Image *image; int delay; int offsetX; int offsetY; + int rand; FrameType type; std::string nextAction; }; @@ -61,13 +63,14 @@ class Animation /** * Appends a new animation at the end of the sequence. */ - void addFrame(Image *image, int delay, int offsetX, int offsetY); + void addFrame(Image *image, int delay, int offsetX, int offsetY, + int rand); /** * Appends an animation terminator that states that the animation * should not loop. */ - void addTerminator(); + void addTerminator(int rand); /** * Returns the frame at the specified index. @@ -87,7 +90,11 @@ class Animation int getDuration() const { return mDuration; } - void addJump(std::string name); + void addJump(std::string name, int rand); + + void addLabel(std::string name); + + void addGoto(std::string name, int rand); /** * Determines whether the given animation frame is a terminator. |