summary refs log tree commit diff stats
path: root/gamestate.h
diff options
context:
space:
mode:
authorStarla Insigna <starla4444@gmail.com>2013-08-27 11:39:37 -0400
committerStarla Insigna <starla4444@gmail.com>2013-08-27 11:39:37 -0400
commitffd335aca284c286030e2b26f1a02a0441748f46 (patch)
treebcc1c241621fe159ae7ef178122fb41c5f23eb00 /gamestate.h
parentd47da18958b5214def5127e201f60668c566d9bb (diff)
downloadmazeoflife-ffd335aca284c286030e2b26f1a02a0441748f46.tar.gz
mazeoflife-ffd335aca284c286030e2b26f1a02a0441748f46.tar.bz2
mazeoflife-ffd335aca284c286030e2b26f1a02a0441748f46.zip
Started rewriting game from scratch with SDL2
Only the title screen is currently implemented
Diffstat (limited to 'gamestate.h')
-rw-r--r--gamestate.h59
1 files changed, 0 insertions, 59 deletions
diff --git a/gamestate.h b/gamestate.h deleted file mode 100644 index 28b85c0..0000000 --- a/gamestate.h +++ /dev/null
@@ -1,59 +0,0 @@
1#ifndef GAMESTATE_H
2#define GAMESTATE_H
3
4class GameState : public State {
5 public:
6 GameState();
7 void input(SDL_keysym 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 int gens;
33 };
34
35 class Board
36 {
37 private:
38 bool blocks[WIDTH][HEIGHT];
39 void incrementIfNeighbor(int x, int y, bool temp[WIDTH][HEIGHT], int* tick);
40 GameState::Info* info;
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