summary refs log tree commit diff stats
path: root/src/game.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2015-03-10 19:42:04 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2015-03-10 19:42:04 -0400
commit0e0389752a0912614737e5c059b5cd4719ef9cf2 (patch)
treefc39e676bd819ee973f27fc40150a7874d2f8503 /src/game.h
parent7f0e8c7ef70c62814c274f110367db92f01cbb26 (diff)
downloadtherapy-0e0389752a0912614737e5c059b5cd4719ef9cf2.tar.gz
therapy-0e0389752a0912614737e5c059b5cd4719ef9cf2.tar.bz2
therapy-0e0389752a0912614737e5c059b5cd4719ef9cf2.zip
Const correctness!
Also created savefile and refactored collisions a bit.
Diffstat (limited to 'src/game.h')
-rw-r--r--src/game.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/game.h b/src/game.h index c419c5d..69b8df7 100644 --- a/src/game.h +++ b/src/game.h
@@ -17,12 +17,19 @@ const int MAP_HEIGHT = GAME_HEIGHT/TILE_HEIGHT;
17const int FRAMES_PER_SECOND = 60; 17const int FRAMES_PER_SECOND = 60;
18const double SECONDS_PER_FRAME = 1.0 / FRAMES_PER_SECOND; 18const double SECONDS_PER_FRAME = 1.0 / FRAMES_PER_SECOND;
19 19
20struct Savefile {
21 const Map* map;
22 std::pair<double, double> position;
23};
24
20class Game { 25class Game {
21 public: 26 public:
22 Game(); 27 Game();
23 void execute(GLFWwindow* window); 28 void execute(GLFWwindow* window);
24 void loadMap(Map& map); 29 void loadMap(const Map& map);
25 void detectCollision(Entity& collider, std::pair<double, double> old_position); 30 void detectCollision(Entity& collider, std::pair<double, double> old_position);
31 void saveGame(const Map& map, std::pair<double, double> position);
32 void loadGame(const Map& curMap);
26 33
27 bool shouldQuit = false; 34 bool shouldQuit = false;
28 private: 35 private:
@@ -34,6 +41,7 @@ class Game {
34 std::shared_ptr<Entity> player; 41 std::shared_ptr<Entity> player;
35 Map m{"../maps/embarass.txt"}; 42 Map m{"../maps/embarass.txt"};
36 Map m2{"../maps/second.txt"}; 43 Map m2{"../maps/second.txt"};
44 Savefile save;
37}; 45};
38 46
39#endif 47#endif