-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmultisprite.h
More file actions
41 lines (33 loc) · 872 Bytes
/
multisprite.h
File metadata and controls
41 lines (33 loc) · 872 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
#ifndef MULTISPRITE__H
#define MULTISPRITE__H
#include <string>
#include <vector>
#include "drawable.h"
class MultiSprite : public Drawable {
public:
MultiSprite(const std::string&);
MultiSprite(const std::string& n, const Vector2f& pos, const Vector2f& vel);
MultiSprite(const MultiSprite&);
virtual ~MultiSprite() { }
virtual void draw() const;
virtual void update(Uint32 ticks);
virtual const Frame* getFrame() const {
return frames[currentFrame];
}
float getScale() const {return scale;}
void setScale(float s) { scale=s;}
void reset();
protected:
const std::vector<Frame *> frames;
int worldWidth;
int worldHeight;
unsigned currentFrame;
unsigned numberOfFrames;
unsigned frameInterval;
float timeSinceLastFrame;
int frameWidth;
int frameHeight;
float scale;
void advanceFrame(Uint32 ticks);
};
#endif