-
Notifications
You must be signed in to change notification settings - Fork 0
/
sprite.h
35 lines (29 loc) · 855 Bytes
/
sprite.h
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
#ifndef SPRITE__H
#define SPRITE__H
#include <string>
#include "drawable.h"
class ExplodingSprite;
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() { }
virtual const Frame* getFrame() const { return frame; }
virtual void draw() const;
virtual void update(Uint32 ticks);
virtual void explode();
Sprite& operator=(const Sprite& rhs);
virtual bool isExplosion() const { if(explosion) return true; return false; };
private:
ExplodingSprite* explosion;
const Frame * frame;
int frameWidth;
int frameHeight;
int worldWidth;
int worldHeight;
int getDistance(const Sprite*) const;
};
#endif