-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.h
67 lines (55 loc) · 1.27 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
67
#ifndef GAME_H
#define GAME_H
#include <QObject>
#include "enemy/baseenemy.h"
#include "enemy/enemyhelper.h"
#include "tower/basetower.h"
#include "tower/lasertower.h"
#include "wavemanager.h"
#include "view.h"
#include "gameUIenum.h"
#include "gameline.h"
#include <QPropertyAnimation>
#include <QPainterPath>
#include <QGraphicsPathItem>
#include <QDebug>
#include <QList>
#include <QHash>
#include <QTimer>
class game : public QObject
{
Q_OBJECT
public:
game(View* gameView, QObject *parent = 0);
qreal getLife();
qreal getMoney();
qreal getWave();
// qreal getWaveTimer();
signals:
void updateUI(UIupdate upd);
public slots:
void enemyDown(baseEnemy *enemy);
void wave();
void UpdateMoney();
void glyphLoc(QPointF loc, int id);
void drawLine(QPolygonF line);
void startDraw();
// void WaveTimer();
private:
void addTower(int id);
void addLaserTower(int id);
View* gameView;
QHash<int, baseTower*> towers;
QList<baseEnemy*> enemies;
enemyHelper* enemyHelp;
waveManager* wavesMgr;
QPainterPath path;
bool paintOnce = true;
QTimer moneyTimer;
qreal life = 500;
qreal money = 2000;
qreal wave_stat = 1;
bool gameStarted = false;
// qreal wave_timer = 0;
};
#endif // GAME_H