From 2ec163612042bfa5e4e1bf220b489506f7039677 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 18 Mar 2015 09:48:43 -0400 Subject: Game can now read map file from map editor (also added new map) --- src/game.h | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'src/game.h') diff --git a/src/game.h b/src/game.h index 1818cec..3f0fcc8 100644 --- a/src/game.h +++ b/src/game.h @@ -3,21 +3,12 @@ #include #include -#include "renderer.h" #include +#include +#include "map.h" class Entity; -class Map; - -const int TILE_WIDTH = 8; -const int TILE_HEIGHT = 8; -const int GAME_WIDTH = 320; -const int GAME_HEIGHT = 200; -const int MAP_WIDTH = GAME_WIDTH/TILE_WIDTH; -const int MAP_HEIGHT = GAME_HEIGHT/TILE_HEIGHT - 1; - -const int FRAMES_PER_SECOND = 60; -const double SECONDS_PER_FRAME = 1.0 / FRAMES_PER_SECOND; +struct GLFWwindow; struct Savefile { const Map* map; @@ -26,17 +17,21 @@ struct Savefile { class Game { public: - Game(); + Game(const char* maps); void execute(GLFWwindow* window); void loadMap(const Map& map, std::pair position); void detectCollision(Entity& collider, std::pair old_position); void saveGame(); void schedule(double time, std::function callback); void playerDie(); + const Map& getMap(int id) const; private: friend void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods); + std::map maps; + int startMap; + std::pair startPos; std::list> entities; std::list> nextEntities; std::pair nextPosition; -- cgit 1.4.1