From 1af772beadf5d03822c2cbdf80987e0580813602 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 19 Jun 2009 11:35:01 -0400 Subject: Backed out changeset 9cb52f41967c 'Twas a bad idea --- gamestate.h | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 gamestate.h (limited to 'gamestate.h') diff --git a/gamestate.h b/gamestate.h new file mode 100644 index 0000000..7d9d798 --- /dev/null +++ b/gamestate.h @@ -0,0 +1,59 @@ +#ifndef GAMESTATE_H +#define GAMESTATE_H + +class GameState : public State { + public: + GameState(); + void input(SDLKey key); + void tick(); + void render(SDL_Surface* screen); + + class Level + { + private: + int level; + Uint32 alive[5]; + Uint32 dead[5]; + + public: + Level(); + int getLevel(); + int getLevelGroup(); + bool checkSquare(int x, int y); + Uint32 getAliveColor(); + Uint32 getDeadColor(); + void incrementLevel(); + }; + + struct Info { + int playerx, playery; + Level level; + bool doneMaking; + }; + + class Board + { + private: + bool blocks[WIDTH][HEIGHT]; + void incrementIfNeighbor(int x, int y, bool temp[WIDTH][HEIGHT], int* tick); + GameState::Info* info; + int gens; + + public: + Board(); + Board(GameState::Info* info); + bool isObstructed(int x, int y); + void render(SDL_Surface* screen); + void tick(); + }; + + private: + Uint32 player_color; + Uint32 event_color; + bool newGame; + Info info; + Board board; + void move(int x, int y); +}; + +#endif -- cgit 1.4.1