diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-04-03 20:10:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-04-03 20:10:33 +0300 |
commit | 51975cd8624fff3b20aa3b7b1932555e32786561 (patch) | |
tree | 55ff8d9c5a459bada8038807a1eaf0dfe98945e2 /src/resources/animation.cpp | |
parent | fd16292e758ab6fc910ed07441e6e477d616201c (diff) | |
download | mv-51975cd8624fff3b20aa3b7b1932555e32786561.tar.gz mv-51975cd8624fff3b20aa3b7b1932555e32786561.tar.bz2 mv-51975cd8624fff3b20aa3b7b1932555e32786561.tar.xz mv-51975cd8624fff3b20aa3b7b1932555e32786561.zip |
Add spawn animation to mobs.
Also impliment sound events:
SOUND_EVENT_MOVE, SOUND_EVENT_SIT, SOUND_EVENT_SPAWN
Diffstat (limited to 'src/resources/animation.cpp')
-rw-r--r-- | src/resources/animation.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/resources/animation.cpp b/src/resources/animation.cpp index 328824827..fe5822f7b 100644 --- a/src/resources/animation.cpp +++ b/src/resources/animation.cpp @@ -31,7 +31,7 @@ Animation::Animation(): void Animation::addFrame(Image *image, int delay, int offsetX, int offsetY) { - Frame frame = { image, delay, offsetX, offsetY }; + Frame frame = { image, delay, offsetX, offsetY, "" }; mFrames.push_back(frame); mDuration += delay; } @@ -45,3 +45,9 @@ bool Animation::isTerminator(const Frame &candidate) { return (candidate.image == NULL); } + +void Animation::addJump(std::string name) +{ + Frame frame = { 0, 0, 0, 0, name }; + mFrames.push_back(frame); +} |