-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.h
More file actions
49 lines (45 loc) · 1003 Bytes
/
Copy pathgame.h
File metadata and controls
49 lines (45 loc) · 1003 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
#ifndef GAME_H
#define GAME_H
#include <QVector>
#include <QTimer>
#include <QObject>
#include <windows.h>
#include <QTimer>
#include <stdlib.h>
#include "object.h"
#include "cruiser.h"
#include "fighter.h"
#include "gamegui.h"
#include "enemy.h"
#include "bullet.h"
#include "enemybullet.h"
class Game: public QObject
{
Q_OBJECT
public:
Game(GameGui* gameGui,int width, int height, int updateFrequency);
int getWidth(){ return width; }
int getHeight(){ return height; }
int setExplosion(QPoint pos, QPoint size);
private:
GameGui* gameGui;
QVector<Object*> objects;
int width;
int height;
int updateFrequency;
int score{0};
bool isRunning;
QTimer* gameLoopTimer;
void collisionHandler();
void objectCollision();
void updatePos();
void updateGraphic();
void spawnEnemy();
void updateObjects();
Explosion* ex;
int spawnIterator{0};
int spawnPeriod{60};
private slots:
void updateState();
};
#endif // GAME_H