-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsprite.h
More file actions
31 lines (26 loc) · 732 Bytes
/
sprite.h
File metadata and controls
31 lines (26 loc) · 732 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
#ifndef SPRITE__H
#define SPRITE__H
#include <string>
#include "drawable.h"
class Sprite : public Drawable {
public:
Sprite(const std::string&);
Sprite(const std::string&, const Vector2f& pos, const Vector2f& vel);
Sprite(const std::string&,
const Vector2f& pos, const Vector2f& vel, const Frame*);
Sprite(const Sprite& s);
virtual ~Sprite() { }
Sprite& operator=(const Sprite&);
virtual const Frame* getFrame() const { return frame; }
virtual void draw() const;
virtual void draw(const float scale);
virtual void update(Uint32 ticks);
private:
const Frame * frame;
int frameWidth;
int frameHeight;
int worldWidth;
int worldHeight;
int getDistance(const Sprite*) const;
};
#endif