forked from ZhouBox/air_plane
-
Notifications
You must be signed in to change notification settings - Fork 0
/
space.h
108 lines (78 loc) · 1.83 KB
/
space.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#ifndef SPACE_H
#define SPACE_H
#include <QGraphicsView>
#include <QTimer>
#include <QMessageBox>
#include <exception>
#include <QScopedPointer>
#include "playerPlane.h"
#include "enemyplane.h"
#include "randomizer.h"
#include "scoringdevice.h"
#include "bloodsupply.h"
#include "menuitem.h"
#include "textitem.h"
#include "menuwidget.h"
#include "bulletsupply.h"
#include "bomb.h"
/**
* @brief The Space class 太空
*/
class Space : public QGraphicsView
{
Q_OBJECT
public:
explicit Space(QWidget *parent = 0);
~Space();
signals:
public slots:
protected:
void mouseDoubleClickEvent(QMouseEvent *e);
void mouseMoveEvent(QMouseEvent *event);
protected slots:
void slt_updata();
void slt_enemys();//产生敌机
void slt_playerDead();
void slt_addScore(int score);
void slt_startGame();
void slt_newGame();
void slt_pauseGame();
void slt_supply();
void slt_level(int level);
void slt_menu();
void slt_updataScore(int score);
void slt_updataBlood(int i);
void slt_bulletSupply();
void slt_updataBulletTimes(int flag, int sec);
void slt_aBomb();
private:
QGraphicsScene m_scene;
PlayerPlane *m_player;
TextItem *m_scoreItem;
TextItem *m_bloods;
TextItem *showResult;
TextItem *bulletInfo;
TextItem *bomb;
MenuItem *m_menu;
QTimer m_timer_updata;
ScoringDevice m_scoringCounter;
bool m_isRunning;
int m_step;
bool m_willBomb;
int m_bombs;
QString _3blood;
QString _2blood;
QString _1blood;
QString _0blood;
void timersStop();
void timersStart();
void initSome();
void reInit();
void createAbomb();
void doAbomb();
void setBloodsText(const QString &text);
void setBombText(int val);
void createEnemyM();
void createEnemyL();
};
#endif // SPACE_H