-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmywindow.h
53 lines (51 loc) · 1.08 KB
/
mywindow.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 MYWINDOW_H
#define MYWINDOW_H
#include"Tower.h"
#include <QMainWindow>
#include<QList>
#include <QMediaPlayer>
#include<QPainter>
#include<QPixmap>
#include <QTextEdit>
#include<QPoint>
#include<QDebug>
#include<QTimer>
#include<QSoundEffect>
#include"enemy.h"
class Mywindow : public QMainWindow
{
Q_OBJECT
public:
explicit Mywindow(QWidget *parent = nullptr);
void paintEvent(QPaintEvent *);
void playmusic();
void mousePressEvent(QMouseEvent*event);
bool canBuyTower();
void set_tower1();
void set_tower2();
void set_tower3();
bool has_tower(QPoint pos);
void set_enemy();
void addWayPoints();
void start_timer();
int tem=0;
public slots:
void movenemy();
private:
QList<Tower*>towerlist;
QList<enemy*>enemylist;
QList<QPoint*>waylist;
QPoint pressPos1;
QPoint*startpoint;
QPoint pressPos2;
QTimer* timer1;
int count=0;
int lifecount=10;
int money=1000;
char s1[100]={0};
char s2[100]={0};
QSoundEffect*player1;
QSoundEffect*player2;
QMediaPlayer*player3;
};
#endif // MYWINDOW_H