-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.h
42 lines (38 loc) · 780 Bytes
/
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
#pragma once
#include <QWidget>
#include <QTimer>
#include <QMessageBox>
#include "GameBoard.h"
#include "Pacman.h"
#include "Direction.h"
#include "Point.h"
#include "EndScreen.h"
#include "Pinky.h"
#include "Blinky.h"
#include "Clyde.h"
#include "Inky.h"
class Game : public QWidget
{
Q_OBJECT
public:
Game(QWidget *parent = nullptr);
private:
void initObjects();
void loadPoints();
void initGhosts();
void eatPoint();
void reset();
void showEndScreen(QString str);
void checkCollisions();
void checkResult();
void moveGhosts();
GameBoard *board;
Pacman *pacman;
EndScreen *endScreen;
QTimer *timer;
QVector<Point *> points;
QVector<Ghost *> ghosts;
private slots:
void step();
void resetSlot();
};