diff options
Diffstat (limited to 'src/game.h')
-rw-r--r-- | src/game.h | 10 |
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; | |||
17 | const int FRAMES_PER_SECOND = 60; | 17 | const int FRAMES_PER_SECOND = 60; |
18 | const double SECONDS_PER_FRAME = 1.0 / FRAMES_PER_SECOND; | 18 | const double SECONDS_PER_FRAME = 1.0 / FRAMES_PER_SECOND; |
19 | 19 | ||
20 | struct Savefile { | ||
21 | const Map* map; | ||
22 | std::pair<double, double> position; | ||
23 | }; | ||
24 | |||
20 | class Game { | 25 | class 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 |