-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsys.h
56 lines (52 loc) · 1.45 KB
/
sys.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
#ifndef SYS_H
#define SYS_H
#include <QPainter>
#include <QtMath>
#include <QtCore/QObject>
#include <QDebug>
#include <QBitmap>
#include <QScopedPointer>
#include <QPointer>
#include <QList>
#include <QSound>
const double RESOLUTION = 1.5 ;
const double WINDOW_WHITH = 288*RESOLUTION ;
const double WINDOW_HEIGHT = 512*RESOLUTION ;
const int COLLI_SIZE = 9 ;
const int LAYER_BACK = 0 ;
const int LAYER_PIPE = 100 ;
const int LAYER_GROUND = 200 ;
const int LAYER_PLAYER = 300 ;
const int LAYER_LABEL = 400 ;
const int LAYER_TOP = 500 ;
namespace MYSOUND
{
enum {DIE=0,FLY,HIT,PANEL,POINT};
}
namespace THREAD
{
enum {FRAME=0,STATE,SOUND};
}
namespace STATE
{
enum {START,RUN,DROP,OVER,RESTART};
}
class Widget;
class Global
{
public:
Global();
void SetMainWidget(Widget * const p);
Widget * GetMainWidget() const;
void ResInit();
QPixmap nullimg,background[2],ground,bird[3][3],game_ready,num[2][10],white,black,pipe_down,pipe_up,
game_over,score_board,button_play,medals[4],new_record;
QPointer<QSound> sound[5];
private:
Widget * user=nullptr;
QPixmap set(int ,int ,int ,int );
QPixmap back_temp;
};
extern Global * sys; //全局变量
void DrawPixmapAtCenter(double x,double y,QPixmap& img,QPainter &p);
#endif // SYS_H