Diffstat (limited to 'noncore/games/sfcave/sfcave.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/sfcave/sfcave.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/noncore/games/sfcave/sfcave.h b/noncore/games/sfcave/sfcave.h index 238a615..65e5ae4 100644 --- a/noncore/games/sfcave/sfcave.h +++ b/noncore/games/sfcave/sfcave.h | |||
@@ -3,25 +3,26 @@ | |||
3 | #include <qpixmap.h> | 3 | #include <qpixmap.h> |
4 | #include <qpoint.h> | 4 | #include <qpoint.h> |
5 | #include <qrect.h> | 5 | #include <qrect.h> |
6 | #include <qtimer.h> | 6 | #include <qtimer.h> |
7 | #include <qlist.h> | 7 | #include <qlist.h> |
8 | 8 | ||
9 | #include "random.h" | 9 | #include "random.h" |
10 | 10 | ||
11 | #define MAPSIZE 52 | 11 | #define MAPSIZE 52 |
12 | #define BLOCKSIZE 6 | 12 | #define BLOCKSIZE 6 |
13 | #define TRAILSIZE 30 | 13 | #define TRAILSIZE 30 |
14 | 14 | ||
15 | 15 | #define NR_MENUS 3 | |
16 | #define MAX_MENU_OPTIONS 8 | ||
16 | 17 | ||
17 | class SFCave : public QMainWindow | 18 | class SFCave : public QMainWindow |
18 | { | 19 | { |
19 | Q_OBJECT | 20 | Q_OBJECT |
20 | 21 | ||
21 | public: | 22 | public: |
22 | int sWidth; | 23 | int sWidth; |
23 | int sHeight; | 24 | int sHeight; |
24 | int segSize; | 25 | int segSize; |
25 | 26 | ||
26 | int currentSeed; | 27 | int currentSeed; |
27 | 28 | ||
@@ -44,28 +45,28 @@ public: | |||
44 | static double MaxDownThrustVals[3][3]; | 45 | static double MaxDownThrustVals[3][3]; |
45 | static int initialGateGaps[]; | 46 | static int initialGateGaps[]; |
46 | 47 | ||
47 | double thrustUp; | 48 | double thrustUp; |
48 | double noThrust; | 49 | double noThrust; |
49 | double maxUpThrust; | 50 | double maxUpThrust; |
50 | double maxDownThrust; | 51 | double maxDownThrust; |
51 | 52 | ||
52 | int gateDistance; | 53 | int gateDistance; |
53 | int nextGate; | 54 | int nextGate; |
54 | int lastGateBottomY; | 55 | int lastGateBottomY; |
55 | 56 | ||
56 | static QString menuOptions[2][5]; | 57 | static QString menuOptions[NR_MENUS][MAX_MENU_OPTIONS]; |
57 | int currentMenuNr; | 58 | int currentMenuNr; |
58 | static int nrMenuOptions[2]; | 59 | static int nrMenuOptions[NR_MENUS]; |
59 | static int currentMenuOption[2]; | 60 | static int currentMenuOption[NR_MENUS]; |
60 | 61 | ||
61 | static QString dificultyOption[3]; | 62 | static QString dificultyOption[3]; |
62 | static QString gameTypes[3]; | 63 | static QString gameTypes[3]; |
63 | int currentGameType; | 64 | int currentGameType; |
64 | int currentGameDifficulty; | 65 | int currentGameDifficulty; |
65 | 66 | ||
66 | QPixmap *offscreen; | 67 | QPixmap *offscreen; |
67 | QTimer *gameTimer; | 68 | QTimer *gameTimer; |
68 | 69 | ||
69 | int score; | 70 | int score; |
70 | int highestScore[3][3]; | 71 | int highestScore[3][3]; |
71 | 72 | ||
@@ -98,24 +99,25 @@ public: | |||
98 | bool checkFlyGameCollision(); | 99 | bool checkFlyGameCollision(); |
99 | void moveFlyGameLandscape(); | 100 | void moveFlyGameLandscape(); |
100 | void setFlyPoint( int point ); | 101 | void setFlyPoint( int point ); |
101 | bool checkCollision(); | 102 | bool checkCollision(); |
102 | void moveLandscape(); | 103 | void moveLandscape(); |
103 | void addBlock(); | 104 | void addBlock(); |
104 | void addGate(); | 105 | void addGate(); |
105 | void setPoint( int point ); | 106 | void setPoint( int point ); |
106 | void drawBoss(); | 107 | void drawBoss(); |
107 | void draw(); | 108 | void draw(); |
108 | void handleKeys(); | 109 | void handleKeys(); |
109 | 110 | ||
111 | void handleMenuKeys( QKeyEvent * e ); | ||
110 | void displayMenu(); | 112 | void displayMenu(); |
111 | void dealWithMenuSelection(); | 113 | void dealWithMenuSelection(); |
112 | 114 | ||
113 | void keyPressEvent( QKeyEvent *e ); | 115 | void keyPressEvent( QKeyEvent *e ); |
114 | void keyReleaseEvent( QKeyEvent *e ); | 116 | void keyReleaseEvent( QKeyEvent *e ); |
115 | void saveScore(); | 117 | void saveScore(); |
116 | void saveReplay(); | 118 | void saveReplay(); |
117 | void loadReplay(); | 119 | void loadReplay(); |
118 | 120 | ||
119 | private slots: | 121 | private slots: |
120 | void run(); | 122 | void run(); |
121 | }; | 123 | }; |