-
Notifications
You must be signed in to change notification settings - Fork 1
/
sprite.H
55 lines (35 loc) · 803 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
Pacman remake
Author: Alejandro Mujica (aledrums@gmail.com)
*/
# ifndef SPRITE_H
# define SPRITE_H
class QPainter;
# include <QString>
# include <element.H>
enum Sprite_Type
{
ST_Pacman, ST_Ghost
};
class Sprite : public Element
{
static constexpr unsigned int Max_Num_Images = 10;
protected:
unsigned int num_images;
QString images_names[Max_Num_Images];
unsigned int curr_image_idx;
real timer;
real time_interval;
public:
Sprite();
Sprite(const Sprite &);
Sprite(Sprite &&);
~Sprite();
void add_image(const QString &);
Sprite & operator = (const Sprite &);
Sprite & operator = (Sprite &&);
virtual void draw(QPainter &);
void update(const real &) override;
virtual Sprite_Type type() const = 0;
};
# endif // SPRITE_H