-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtwRotateMultisprite.h
More file actions
37 lines (31 loc) · 835 Bytes
/
twRotateMultisprite.h
File metadata and controls
37 lines (31 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef TWMULTISPRITE__H
#define TWMULTISPRITE__H
#include <string>
#include <vector>
#include "drawable.h"
class TWRotateMultiSprite : public Drawable {
public:
TWRotateMultiSprite(const std::string&);
TWRotateMultiSprite(const TWRotateMultiSprite&);
virtual ~TWRotateMultiSprite() { }
virtual void draw() const;
virtual void update(Uint32 ticks);
virtual const Frame* getFrame() const {
if (!flag){return frames[currentFrame];}
else {return framesMirror[currentFrame];}
}
protected:
const std::vector<Frame *> frames;
const std::vector<Frame *> framesMirror;
int worldWidth;
int worldHeight;
unsigned currentFrame;
unsigned numberOfFrames;
unsigned frameInterval;
float timeSinceLastFrame;
int frameWidth;
int frameHeight;
bool flag;
void advanceFrame(Uint32 ticks);
};
#endif