From 7f0e8c7ef70c62814c274f110367db92f01cbb26 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 10 Mar 2015 00:41:59 -0400 Subject: C++11'd everything! Also moved location information from physics components into entity. --- src/game.h | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) (limited to 'src/game.h') diff --git a/src/game.h b/src/game.h index 69224dc..c419c5d 100644 --- a/src/game.h +++ b/src/game.h @@ -1,7 +1,11 @@ #ifndef GAME_H #define GAME_H -#include "components.h" +class Game; + +#include "map.h" +#include +#include "entity.h" const int TILE_WIDTH = 8; const int TILE_HEIGHT = 8; @@ -15,29 +19,21 @@ const double SECONDS_PER_FRAME = 1.0 / FRAMES_PER_SECOND; class Game { public: - static Game& getInstance() - { - static Game instance; - - return instance; - } - - ~Game(); - void execute(); - void loadMap(Map* map); - void input(int key, int action); + Game(); + void execute(GLFWwindow* window); + void loadMap(Map& map); + void detectCollision(Entity& collider, std::pair old_position); bool shouldQuit = false; private: - Game(); - Game(Game const&); - void operator=(Game const&); - - GLFWwindow* window; - World* world; - World* nextWorld; - Map* m; - Map* m2; + friend void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods); + + std::list> entities; + std::list> nextEntities; + bool newWorld; + std::shared_ptr player; + Map m{"../maps/embarass.txt"}; + Map m2{"../maps/second.txt"}; }; #endif -- cgit 1.4.1