-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainscene.h
78 lines (69 loc) · 1.49 KB
/
mainscene.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
#ifndef MAINSCENE_H
#define MAINSCENE_H
#include <QWidget>
#include <QIcon>
#include <QTimer>
#include <QPainter>
#include <QMouseEvent>
#include <ctime>
#include <QDebug>
#include <QLabel>
#include <QPushButton>
#include <QMessageBox>
#include <QSysInfo>
#include <QEventLoop>
#include <QApplication>
#include <QDate>
#include "config.h"
#include "map.h"
#include "plane.h"
#include "enemyplane.h"
#include "boss.h"
#include "bomb.h"
class MainScene : public QWidget
{
Q_OBJECT
public:
MainScene(QWidget *parent = nullptr);
~MainScene();
void initScene();
void playGame();
void updatePosition();
void enemyToScene();
void bossToScene();
void collisionDetection();
void updateScore();
void updateLife();
void updateEnergy();
void EnergyPlay();
void updateBoss();
void deleteBoss();
void paintEvent(QPaintEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void keyPressEvent(QKeyEvent *event);
Map m_map;
QTimer m_Timer;
Plane m_plane;
EnemyPlane m_enemys[ENEMY_NUM];
Boss *m_boss;
int m_recorder;
Bomb m_bombs[BOMB_NUM];
bool nplane;
int bosspos;
SBG CONSTBOSS;
long long m_score;
long long m_life;
long long m_energy;
QLabel *name;
QLabel *score;
QLabel *life;
QLabel *energy;
QLabel *all;
QLabel *status;
QLabel *bossbar;
// QPushButton *quitb;
// QPushButton *eneb;
// Bullet temp_bullet;
// EnemyBullet temp_bullet;
};
#endif // MAINSCENE_H