-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspaceinvaders.h
61 lines (52 loc) · 1006 Bytes
/
spaceinvaders.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
#ifndef SPACEINVADERS_H
#define SPACEINVADERS_H
#include "shooter.h"
#include "alien.h"
#include "bullet.h"
#include "alien2.h"
#include "alienboss.h"
#include "alien3.h"
#include "spaceship.h"
//#include "bomb.h"
#include <QWidget>
#include <QKeyEvent>
class SpaceInvaders : public QWidget
{
Q_OBJECT
public:
SpaceInvaders(QWidget *parent = 0);
~SpaceInvaders();
protected:
void paintEvent(QPaintEvent *event);
void timerEvent(QTimerEvent *event);
void keyPressEvent(QKeyEvent *event);
void victory();
void checkCollision();
public slots:
void startGame();
void pauseGame();
void stopGame();
signals:
void scoreChanged(int);
void levelChanged(int);
void livesChanged(int);
private:
int xShooter;
int timerId;
int level;
int score;
int lives;
Shooter *shooter;
Alien *alien[5];
AlienTwo *alientwo[3];
Spaceship *spaceship;
AlienThree *alienthree[4];
AlienBoss *boss;
Bullet *bullet;
//Bomb *bomb;
bool gameOver;
bool gameWon;
bool gameStarted;
bool paused;
};
#endif