-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.h
66 lines (43 loc) · 1.1 KB
/
Game.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
55
56
57
58
59
60
61
62
63
64
65
66
/** @file Game.h
@brief This file contains class and member function declarations for Game class.
The Game constructor sets up the scene, health, score, tower icons,
background music enemy path, and spawns enemies.
*/
#ifndef GAME_H
#define GAME_H
#include <QGraphicsView>
#include <QMouseEvent>
#include <QMouseEvent>
#include "Tower.h"
#include "Score.h"
#include "Health.h"
#include "Enemy.h"
#include "Player.h"
class Game: public QGraphicsView
{
Q_OBJECT
public:
//member functions
Game();
void setCursor(QString filename);
//void mousePressEvent(QMouseEvent* event);
void mouseMoveEvent(QMouseEvent* event);
void mousePressEvent(QMouseEvent *event);
void createRoad();
//member attributes
QGraphicsScene* scene;
QGraphicsPixmapItem* cursor;
Tower* building;
QTimer* spawnTimer;
QTimer* waveTimer;
int enemiesSpawned;
int maxNumberOfEnemies;
QList<QPointF> pointsToFollow;
Score* score;
Health* health;
Player * player;
public slots:
void spawnEnemy();
void createEnemies(int numberOfEnemies);
};
#endif // GAME_H