-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalien.h
More file actions
50 lines (37 loc) · 825 Bytes
/
alien.h
File metadata and controls
50 lines (37 loc) · 825 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
45
46
47
48
49
50
#ifndef ALIEN_H
#define ALIEN_H
#include <QGraphicsPixmapItem>
#include <QGraphicsScene>
#include "bullet.h"
enum class CAlienType {
LOWER,
MIDDLE,
UPPER,
BOSS
};
class CAlien : public QObject, public QGraphicsPixmapItem
{
Q_OBJECT
public :
CAlien(CAlienType type, int stage, QGraphicsItem* pParent = nullptr);
~CAlien();
void advance(int step) override;
void shoot();
void setBelow(CAlien *below);
void setAbove(CAlien *above);
CAlien *getBelow();
CAlien *getAbove();
static int alienCount;
signals:
void sigDecreaseHealth();
void sigDecreaseScore();
void sigGameOver();
private:
CAlienType type;
int stage;
bool goingRight = true;
int formationPosition = 0;
CAlien *below = nullptr;
CAlien *above = nullptr;
};
#endif