Diffstat (limited to 'noncore/games/sfcave/sfcave.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/sfcave/sfcave.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/noncore/games/sfcave/sfcave.h b/noncore/games/sfcave/sfcave.h new file mode 100644 index 0000000..18eeef9 --- a/dev/null +++ b/noncore/games/sfcave/sfcave.h | |||
@@ -0,0 +1,76 @@ | |||
1 | #include <qmainwindow.h> | ||
2 | #include <qpainter.h> | ||
3 | #include <qpixmap.h> | ||
4 | #include <qpoint.h> | ||
5 | #include <qrect.h> | ||
6 | #include <qtimer.h> | ||
7 | |||
8 | |||
9 | |||
10 | #define MAPSIZE 52 | ||
11 | #define BLOCKSIZE 5 | ||
12 | #define TRAILSIZE 30 | ||
13 | |||
14 | #define STATE_BOSS 0 | ||
15 | #define STATE_RUNNING 1 | ||
16 | #define STATE_CRASHED 2 | ||
17 | #define STATE_NEWGAME 3 | ||
18 | |||
19 | class Main : public QMainWindow | ||
20 | { | ||
21 | Q_OBJECT | ||
22 | |||
23 | public: | ||
24 | int sWidth; | ||
25 | int sHeight; | ||
26 | int segSize; | ||
27 | |||
28 | int blockWidth; | ||
29 | int blockHeight; | ||
30 | int state; | ||
31 | int prevState; | ||
32 | int speed; | ||
33 | int crashLineLength; | ||
34 | |||
35 | QPixmap *offscreen; | ||
36 | QTimer *gameTimer; | ||
37 | |||
38 | int score; | ||
39 | int highestScore; | ||
40 | |||
41 | int mapTop[52]; | ||
42 | int mapBottom[52]; | ||
43 | QRect blocks[5]; | ||
44 | QRect user; | ||
45 | QPoint trail[30]; | ||
46 | |||
47 | int offset; | ||
48 | int maxHeight; | ||
49 | int nrFrames; | ||
50 | int dir; | ||
51 | |||
52 | bool bossMode; | ||
53 | |||
54 | bool press; | ||
55 | double thrust; | ||
56 | bool running; | ||
57 | |||
58 | Main( int speed = 3, QWidget *p = 0, char *name = 0 ); | ||
59 | ~Main(); | ||
60 | void start(); | ||
61 | int nextInt( int range ); | ||
62 | void setUp(); | ||
63 | bool checkCollision(); | ||
64 | void moveLandscape(); | ||
65 | void addBlock(); | ||
66 | void setPoint( int point ); | ||
67 | void drawBoss(); | ||
68 | void draw(); | ||
69 | void handleKeys(); | ||
70 | |||
71 | void keyPressEvent( QKeyEvent *e ); | ||
72 | void keyReleaseEvent( QKeyEvent *e ); | ||
73 | |||
74 | private slots: | ||
75 | void run(); | ||
76 | }; | ||