-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtwMultisprite.h
More file actions
44 lines (38 loc) · 939 Bytes
/
twMultisprite.h
File metadata and controls
44 lines (38 loc) · 939 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
38
39
40
41
42
43
44
#ifndef twMultisprite__H
#define twMultisprite__H
#include <string>
#include <vector>
#include "drawable.h"
class TWMultiSprite : public Drawable {
public:
friend class Player;
TWMultiSprite(const std::string&);
TWMultiSprite(const TWMultiSprite&);
virtual ~TWMultiSprite() { }
virtual void draw() const;
virtual void update(Uint32 ticks);
//void right();
//void left();
//void up();
//void down();
//void stop();
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 int currentFrame;
unsigned int numberOfFrames;
unsigned int frameInterval;
float timeSinceLastFrame;
int frameWidth;
int frameHeight;
bool flag;
bool flagStop;
void advanceFrame(Uint32 ticks);
};
#endif