diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2009-06-19 11:35:01 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2009-06-19 11:35:01 -0400 |
commit | 1af772beadf5d03822c2cbdf80987e0580813602 (patch) | |
tree | 87429dc20246f1e76108cec688971a5c2af95181 /gamestate.h | |
parent | 684a27ce13a9a08f4f1d94621cdab1232d2d33cf (diff) | |
download | mazeoflife-1af772beadf5d03822c2cbdf80987e0580813602.tar.gz mazeoflife-1af772beadf5d03822c2cbdf80987e0580813602.tar.bz2 mazeoflife-1af772beadf5d03822c2cbdf80987e0580813602.zip |
Backed out changeset 9cb52f41967c
'Twas a bad idea
Diffstat (limited to 'gamestate.h')
-rw-r--r-- | gamestate.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/gamestate.h b/gamestate.h new file mode 100644 index 0000000..7d9d798 --- /dev/null +++ b/gamestate.h | |||
@@ -0,0 +1,59 @@ | |||
1 | #ifndef GAMESTATE_H | ||
2 | #define GAMESTATE_H | ||
3 | |||
4 | class GameState : public State { | ||
5 | public: | ||
6 | GameState(); | ||
7 | void input(SDLKey key); | ||
8 | void tick(); | ||
9 | void render(SDL_Surface* screen); | ||
10 | |||
11 | class Level | ||
12 | { | ||
13 | private: | ||
14 | int level; | ||
15 | Uint32 alive[5]; | ||
16 | Uint32 dead[5]; | ||
17 | |||
18 | public: | ||
19 | Level(); | ||
20 | int getLevel(); | ||
21 | int getLevelGroup(); | ||
22 | bool checkSquare(int x, int y); | ||
23 | Uint32 getAliveColor(); | ||
24 | Uint32 getDeadColor(); | ||
25 | void incrementLevel(); | ||
26 | }; | ||
27 | |||
28 | struct Info { | ||
29 | int playerx, playery; | ||
30 | Level level; | ||
31 | bool doneMaking; | ||
32 | }; | ||
33 | |||
34 | class Board | ||
35 | { | ||
36 | private: | ||
37 | bool blocks[WIDTH][HEIGHT]; | ||
38 | void incrementIfNeighbor(int x, int y, bool temp[WIDTH][HEIGHT], int* tick); | ||
39 | GameState::Info* info; | ||
40 | int gens; | ||
41 | |||
42 | public: | ||
43 | Board(); | ||
44 | Board(GameState::Info* info); | ||
45 | bool isObstructed(int x, int y); | ||
46 | void render(SDL_Surface* screen); | ||
47 | void tick(); | ||
48 | }; | ||
49 | |||
50 | private: | ||
51 | Uint32 player_color; | ||
52 | Uint32 event_color; | ||
53 | bool newGame; | ||
54 | Info info; | ||
55 | Board board; | ||
56 | void move(int x, int y); | ||
57 | }; | ||
58 | |||
59 | #endif | ||