sprite just has an actor.
--- /dev/null
+//the beggining
+{
+ mFrame(0),
+ mCurrentAnimation(0),
+ mSpriteAnimations.push_back(anim);
+ if(mSpriteAnimations[mCurrentAnimation] -> mBuilt)
+ {
+ if (mSpriteAnimations[mCurrentAnimation]->mNumFrames > 1) mAnimating = 1;
+ }
+}
+Actor::Draw()
+{
+ if(mAnimating == 1) {
+ if(mLastUpdate+mSpriteAnimations[mCurrentAnimation]->mAnim[mFrame].pause*mSpeed<SDL_GetTicks()) {
+ mFrame++;
+ if(mFrame > mSpriteAnimations[mCurrentAnimation]->mNumFrames-1) mFrame=0;
+ mLastUpdate = SDL_GetTicks();
+ }
+ }
+ SDL_Rect dest;
+ dest.x = mX;
+ dest.y = mY;
+ if(mVisible == true)
+ SDL_BlitSurface(mSpriteAnimations[mCurrentAnimation]->mAnim[mFrame].image,NULL,mScreen,&dest);
+}
+
--- /dev/null
+#ifndef SPRITE
+#define SPRITE
+#include "Animation.h"
+#include <SDL/SDL.h>
+#include <vector>
+
+class Sprite
+{
+ public:
+ void draw();
+ std::vector<Animation*> mSpriteAnimations;
+ bool mAnimating;
+ int mCurrentAnimation;
+ bool mDrawn;
+ bool mVisible;
+ int mAnimation;
+}
+