-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.h
executable file
·42 lines (32 loc) · 1.08 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
#ifndef GAME_H
#define GAME_H
#include "player.h"
#include "obstacle.h"
#include <QGraphicsView>
#include <QKeyEvent>
class Game : public QGraphicsView
{
Q_OBJECT;
public:
Game(QSize sizeOfScreen, QGraphicsView *parent = nullptr);
void Start();
public slots:
void updatePos();
protected:
void keyPressEvent(QKeyEvent *event) override;
private:
void createLanesAndObstacles();
void createBackground(int numLanes, QString mapPath, QPoint startPoint, QSize size);
void createBanners();
void createPlayer(QPoint startPoint, int moveX, int moveY);
void createObstacles(int numObstacles, QString obstacleType, QSize obstacleSize, \
int obstacleSpeed, int startTime, int startX, int startY, \
QPoint endPoint, QPoint startPoint, int difference);
void collisonCheck();
bool isStartOrPauseLane(int currentLane);
void raiseQuestionPopup(QString message, QString title);
QSize screenSize;
Player *player;
QTimer *playerTimer;
};
#endif // GAME_H