Diffstat (limited to 'noncore/games/sfcave/sfcave.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/sfcave/sfcave.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/noncore/games/sfcave/sfcave.h b/noncore/games/sfcave/sfcave.h index b19d147..69a0e13 100644 --- a/noncore/games/sfcave/sfcave.h +++ b/noncore/games/sfcave/sfcave.h | |||
@@ -7,84 +7,102 @@ | |||
7 | 7 | ||
8 | 8 | ||
9 | 9 | ||
10 | #define MAPSIZE 52 | 10 | #define MAPSIZE 52 |
11 | #define BLOCKSIZE 6 | 11 | #define BLOCKSIZE 6 |
12 | #define TRAILSIZE 30 | 12 | #define TRAILSIZE 30 |
13 | 13 | ||
14 | class SFCave : public QMainWindow | 14 | class SFCave : public QMainWindow |
15 | { | 15 | { |
16 | Q_OBJECT | 16 | Q_OBJECT |
17 | 17 | ||
18 | public: | 18 | public: |
19 | int sWidth; | 19 | int sWidth; |
20 | int sHeight; | 20 | int sHeight; |
21 | int segSize; | 21 | int segSize; |
22 | 22 | ||
23 | int blockWidth; | 23 | int blockWidth; |
24 | int blockHeight; | 24 | int blockHeight; |
25 | int gapHeight; | 25 | int gapHeight; |
26 | int state; | 26 | int state; |
27 | int prevState; | 27 | int prevState; |
28 | int speed; | 28 | int speed; |
29 | int crashLineLength; | 29 | int crashLineLength; |
30 | 30 | ||
31 | static double UpThrustVals[3][3]; | ||
32 | static double DownThrustVals[3][3]; | ||
33 | static double MaxUpThrustVals[3][3]; | ||
34 | static double MaxDownThrustVals[3][3]; | ||
35 | static int initialGateGaps[]; | ||
36 | |||
37 | double thrustUp; | ||
38 | double noThrust; | ||
39 | double maxUpThrust; | ||
40 | double maxDownThrust; | ||
41 | |||
31 | int gateDistance; | 42 | int gateDistance; |
32 | int nextGate; | 43 | int nextGate; |
33 | int lastGateBottomY; | 44 | int lastGateBottomY; |
34 | 45 | ||
35 | static QString menuOptions[2][5]; | 46 | static QString menuOptions[2][5]; |
36 | int currentMenuNr; | 47 | int currentMenuNr; |
37 | int nrMenuOptions[2]; | 48 | static int nrMenuOptions[2]; |
38 | int currentMenuOption[2]; | 49 | static int currentMenuOption[2]; |
39 | 50 | ||
40 | static QString dificultyOption[3]; | 51 | static QString dificultyOption[3]; |
41 | static QString gameTypes[3]; | 52 | static QString gameTypes[3]; |
42 | int currentGameType; | 53 | int currentGameType; |
43 | int currentGameDifficulty; | 54 | int currentGameDifficulty; |
44 | 55 | ||
45 | QPixmap *offscreen; | 56 | QPixmap *offscreen; |
46 | QTimer *gameTimer; | 57 | QTimer *gameTimer; |
47 | 58 | ||
48 | int score; | 59 | int score; |
49 | int highestScore[3]; | 60 | int highestScore[3][3]; |
50 | 61 | ||
51 | int mapTop[MAPSIZE]; | 62 | int mapTop[MAPSIZE]; |
52 | int mapBottom[MAPSIZE]; | 63 | int mapBottom[MAPSIZE]; |
53 | QRect blocks[BLOCKSIZE]; | 64 | QRect blocks[BLOCKSIZE]; |
54 | QRect user; | 65 | QRect user; |
55 | QPoint trail[TRAILSIZE]; | 66 | QPoint trail[TRAILSIZE]; |
56 | 67 | ||
57 | int offset; | 68 | int offset; |
58 | int maxHeight; | 69 | int maxHeight; |
59 | int nrFrames; | 70 | int nrFrames; |
60 | int dir; | 71 | int dir; |
61 | 72 | ||
62 | bool bossMode; | 73 | bool showScoreZones; |
63 | 74 | ||
64 | bool press; | 75 | bool press; |
65 | double thrust; | 76 | double thrust; |
66 | bool running; | 77 | bool running; |
67 | 78 | ||
68 | SFCave( int speed = 3, QWidget *p = 0, char *name = 0 ); | 79 | SFCave( int speed = 3, QWidget *p = 0, char *name = 0 ); |
69 | ~SFCave(); | 80 | ~SFCave(); |
70 | void start(); | 81 | void start(); |
71 | int nextInt( int range ); | 82 | int nextInt( int range ); |
72 | void setUp(); | 83 | void setUp(); |
84 | void handleGameSFCave(); | ||
85 | void handleGameGates(); | ||
86 | void handleGameFly(); | ||
87 | bool checkFlyGameCollision(); | ||
88 | void moveFlyGameLandscape(); | ||
89 | void setFlyPoint( int point ); | ||
73 | bool checkCollision(); | 90 | bool checkCollision(); |
74 | void moveLandscape(); | 91 | void moveLandscape(); |
75 | void addBlock(); | 92 | void addBlock(); |
76 | void addGate(); | 93 | void addGate(); |
77 | void setPoint( int point ); | 94 | void setPoint( int point ); |
78 | void drawBoss(); | 95 | void drawBoss(); |
79 | void draw(); | 96 | void draw(); |
80 | void handleKeys(); | 97 | void handleKeys(); |
81 | 98 | ||
82 | void displayMenu(); | 99 | void displayMenu(); |
83 | void dealWithMenuSelection(); | 100 | void dealWithMenuSelection(); |
84 | 101 | ||
85 | void keyPressEvent( QKeyEvent *e ); | 102 | void keyPressEvent( QKeyEvent *e ); |
86 | void keyReleaseEvent( QKeyEvent *e ); | 103 | void keyReleaseEvent( QKeyEvent *e ); |
104 | void saveScore(); | ||
87 | 105 | ||
88 | private slots: | 106 | private slots: |
89 | void run(); | 107 | void run(); |
90 | }; | 108 | }; |