author | andyq <andyq> | 2003-01-20 23:11:56 (UTC) |
---|---|---|
committer | andyq <andyq> | 2003-01-20 23:11:56 (UTC) |
commit | 92419b025aa5d82bb7592281af5505ff931c2e58 (patch) (unidiff) | |
tree | 374ee9ca86ef716ce388c8a28e38261f6a04ce7a /noncore/games/sfcave-sdl/game.h | |
parent | 02090d2e63ad8398c0a8a9f1fb895a9c6e42514b (diff) | |
download | opie-92419b025aa5d82bb7592281af5505ff931c2e58.zip opie-92419b025aa5d82bb7592281af5505ff931c2e58.tar.gz opie-92419b025aa5d82bb7592281af5505ff931c2e58.tar.bz2 |
Initial Revision
Diffstat (limited to 'noncore/games/sfcave-sdl/game.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/sfcave-sdl/game.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/noncore/games/sfcave-sdl/game.h b/noncore/games/sfcave-sdl/game.h new file mode 100644 index 0000000..56fa6a1 --- a/dev/null +++ b/noncore/games/sfcave-sdl/game.h | |||
@@ -0,0 +1,82 @@ | |||
1 | #ifndef __GAME_H | ||
2 | #define __GAME_H | ||
3 | |||
4 | #include <list> | ||
5 | using namespace std; | ||
6 | |||
7 | #include "sfcave.h" | ||
8 | |||
9 | class Terrain; | ||
10 | class Player; | ||
11 | |||
12 | class Game | ||
13 | { | ||
14 | public: | ||
15 | Game( SFCave *p, int w, int h, int diff ); | ||
16 | virtual ~Game(); | ||
17 | |||
18 | virtual void init( ); | ||
19 | virtual void update( int state ); | ||
20 | virtual void preDraw( SDL_Surface * ); | ||
21 | virtual void draw( SDL_Surface * ); | ||
22 | |||
23 | virtual void stateChanged( int from, int to ); | ||
24 | |||
25 | void setReplay( bool val ) { replay = val; } | ||
26 | |||
27 | void handleKeys( SDL_KeyboardEvent &key ); | ||
28 | QString getGameName() { return gameName; } | ||
29 | int getDifficulty() { return difficulty; } | ||
30 | QString getGameDifficultyText(); | ||
31 | void setDifficulty( int diff ) { difficulty = diff; } | ||
32 | void setDifficulty( string diff ); | ||
33 | |||
34 | long getScore() { return score; } | ||
35 | long getHighScore() { return highScore; } | ||
36 | void increaseScore( long val ) { score += val; } | ||
37 | void clearScore() { score = 0; } | ||
38 | bool gotHighScore() { return (score >= highScore); } | ||
39 | bool isReplayAvailable() { return replayList.size() > 0; } | ||
40 | |||
41 | Terrain *getTerrain() { return terrain; } | ||
42 | |||
43 | void setSeed( int seed ); | ||
44 | void loadReplay( QString file ); | ||
45 | void saveReplay( QString file ); | ||
46 | |||
47 | static Game *createGame( SFCave *p, int w, int h, string game, string difficulty ); | ||
48 | |||
49 | protected: | ||
50 | QString gameName; | ||
51 | |||
52 | int thrustChannel; | ||
53 | |||
54 | int difficulty; | ||
55 | |||
56 | SFCave *parent; | ||
57 | Terrain *terrain; | ||
58 | Player *player; | ||
59 | |||
60 | int nrFrames; | ||
61 | |||
62 | bool press; | ||
63 | |||
64 | int sHeight; | ||
65 | int sWidth; | ||
66 | long score; | ||
67 | long highScore; | ||
68 | |||
69 | // Stuff for the replays | ||
70 | int currentSeed; | ||
71 | |||
72 | // QListIterator<int> *replayIt; | ||
73 | list<int> replayList; | ||
74 | list<int>::iterator replayIt; | ||
75 | //QList<int> replayList; | ||
76 | bool replay; | ||
77 | QString replayFile; | ||
78 | |||
79 | private: | ||
80 | }; | ||
81 | |||
82 | #endif | ||