-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.h
53 lines (42 loc) · 873 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
43
44
45
46
47
48
49
50
51
52
53
#ifndef GAME_H
#define GAME_H
#include <QCloseEvent>
#include <QKeyEvent>
#include <QGraphicsView>
#include <QTimer>
#include <QDebug>
#include "playfield.h"
#include "bomb.h"
#include "player.h"
#include "block.h"
#include "defines.h"
class Game : public QGraphicsView
{
Q_OBJECT
/*Funktionen*/
public:
Game();
~Game();
void draw();
void init();
void keyPressEvent(QKeyEvent* event);
void keyReleaseEvent(QKeyEvent *event);
void closeEvent(QCloseEvent *event)
{
timer->stop();
qDebug()<<"ende";
}
public slots:
void gameloop();
/*Variabeln*/
public:
static const unsigned int Update_Intervall = GAME_UPDATEINTERVALL;
private:
QGraphicsScene * scene;
QTimer * timer;
Bomb * bomb;
Playfield * playfield;
Player * player1, *player2;
unsigned int gametick;
};
#endif // GAME_H