author | andyq <andyq> | 2002-12-07 00:30:30 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-12-07 00:30:30 (UTC) |
commit | ad2a10877ae6e50b1a765a9b7cff14494c65e588 (patch) (unidiff) | |
tree | 261d3461be9861235dff59e908dc650fe98cb346 /noncore/games/sfcave/sfcave.h | |
parent | 22b6762b871b64825e1f8e974636c2d27fef8486 (diff) | |
download | opie-ad2a10877ae6e50b1a765a9b7cff14494c65e588.zip opie-ad2a10877ae6e50b1a765a9b7cff14494c65e588.tar.gz opie-ad2a10877ae6e50b1a765a9b7cff14494c65e588.tar.bz2 |
Upgraded to v1.7 - new menu system, new game types (gates (implemented and working) and fly (not implemented yet)). Also, high scores are persistent and different across game types - not difficultiy yet. Game Difficulty levels added but not yet implemented
-rw-r--r-- | noncore/games/sfcave/sfcave.h | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/noncore/games/sfcave/sfcave.h b/noncore/games/sfcave/sfcave.h index 18eeef9..b19d147 100644 --- a/noncore/games/sfcave/sfcave.h +++ b/noncore/games/sfcave/sfcave.h | |||
@@ -8,15 +8,10 @@ | |||
8 | 8 | ||
9 | 9 | ||
10 | #define MAPSIZE 52 | 10 | #define MAPSIZE 52 |
11 | #define BLOCKSIZE 5 | 11 | #define BLOCKSIZE 6 |
12 | #define TRAILSIZE 30 | 12 | #define TRAILSIZE 30 |
13 | 13 | ||
14 | #define STATE_BOSS 0 | 14 | class SFCave : public QMainWindow |
15 | #define STATE_RUNNING 1 | ||
16 | #define STATE_CRASHED 2 | ||
17 | #define STATE_NEWGAME 3 | ||
18 | |||
19 | class Main : public QMainWindow | ||
20 | { | 15 | { |
21 | Q_OBJECT | 16 | Q_OBJECT |
22 | 17 | ||
@@ -27,22 +22,37 @@ public: | |||
27 | 22 | ||
28 | int blockWidth; | 23 | int blockWidth; |
29 | int blockHeight; | 24 | int blockHeight; |
25 | int gapHeight; | ||
30 | int state; | 26 | int state; |
31 | int prevState; | 27 | int prevState; |
32 | int speed; | 28 | int speed; |
33 | int crashLineLength; | 29 | int crashLineLength; |
34 | 30 | ||
31 | int gateDistance; | ||
32 | int nextGate; | ||
33 | int lastGateBottomY; | ||
34 | |||
35 | static QString menuOptions[2][5]; | ||
36 | int currentMenuNr; | ||
37 | int nrMenuOptions[2]; | ||
38 | int currentMenuOption[2]; | ||
39 | |||
40 | static QString dificultyOption[3]; | ||
41 | static QString gameTypes[3]; | ||
42 | int currentGameType; | ||
43 | int currentGameDifficulty; | ||
44 | |||
35 | QPixmap *offscreen; | 45 | QPixmap *offscreen; |
36 | QTimer *gameTimer; | 46 | QTimer *gameTimer; |
37 | 47 | ||
38 | int score; | 48 | int score; |
39 | int highestScore; | 49 | int highestScore[3]; |
40 | 50 | ||
41 | int mapTop[52]; | 51 | int mapTop[MAPSIZE]; |
42 | int mapBottom[52]; | 52 | int mapBottom[MAPSIZE]; |
43 | QRect blocks[5]; | 53 | QRect blocks[BLOCKSIZE]; |
44 | QRect user; | 54 | QRect user; |
45 | QPoint trail[30]; | 55 | QPoint trail[TRAILSIZE]; |
46 | 56 | ||
47 | int offset; | 57 | int offset; |
48 | int maxHeight; | 58 | int maxHeight; |
@@ -55,19 +65,23 @@ public: | |||
55 | double thrust; | 65 | double thrust; |
56 | bool running; | 66 | bool running; |
57 | 67 | ||
58 | Main( int speed = 3, QWidget *p = 0, char *name = 0 ); | 68 | SFCave( int speed = 3, QWidget *p = 0, char *name = 0 ); |
59 | ~Main(); | 69 | ~SFCave(); |
60 | void start(); | 70 | void start(); |
61 | int nextInt( int range ); | 71 | int nextInt( int range ); |
62 | void setUp(); | 72 | void setUp(); |
63 | bool checkCollision(); | 73 | bool checkCollision(); |
64 | void moveLandscape(); | 74 | void moveLandscape(); |
65 | void addBlock(); | 75 | void addBlock(); |
76 | void addGate(); | ||
66 | void setPoint( int point ); | 77 | void setPoint( int point ); |
67 | void drawBoss(); | 78 | void drawBoss(); |
68 | void draw(); | 79 | void draw(); |
69 | void handleKeys(); | 80 | void handleKeys(); |
70 | 81 | ||
82 | void displayMenu(); | ||
83 | void dealWithMenuSelection(); | ||
84 | |||
71 | void keyPressEvent( QKeyEvent *e ); | 85 | void keyPressEvent( QKeyEvent *e ); |
72 | void keyReleaseEvent( QKeyEvent *e ); | 86 | void keyReleaseEvent( QKeyEvent *e ); |
73 | 87 | ||