summary refs log tree commit diff stats
path: root/src/game.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-21 17:56:17 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-21 17:56:17 -0500
commit5df0d0616ee3996add0b14e0fb0becd6257d04a2 (patch)
tree19bf067462ea04abf500e0427d3daeb3a39434ee /src/game.h
parentecbe17b582803aaeaa9ccee88a3d093ff93a6cd3 (diff)
downloadtanetane-5df0d0616ee3996add0b14e0fb0becd6257d04a2.tar.gz
tanetane-5df0d0616ee3996add0b14e0fb0becd6257d04a2.tar.bz2
tanetane-5df0d0616ee3996add0b14e0fb0becd6257d04a2.zip
Added a debug console
Open it by pressing backtick, close it by hitting escape. Pressing backtick does not open it in release builds.

Current shortcomings: opening it for the first time also types a backtick for some reason, but not on subsequent times. Also, it doesn't create a coroutine, so any script function that yields is going to fail.

This also added a "is gameplay paused" flag to Game, which will be useful for adding a pause menu.
Diffstat (limited to 'src/game.h')
-rw-r--r--src/game.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/game.h b/src/game.h index 72dd337..756ce70 100644 --- a/src/game.h +++ b/src/game.h
@@ -86,6 +86,12 @@ public:
86 86
87 std::mt19937& getRng() { return *rng_; } 87 std::mt19937& getRng() { return *rng_; }
88 88
89 void pauseGameplay() { paused_ = true; }
90
91 void unpauseGameplay() { paused_ = false; }
92
93 bool isGameplayPaused() const { return paused_; }
94
89private: 95private:
90 96
91 Mixer mixer_; 97 Mixer mixer_;
@@ -101,6 +107,7 @@ private:
101 std::unique_ptr<Map> map_; 107 std::unique_ptr<Map> map_;
102 Font font_; 108 Font font_;
103 std::mt19937* rng_; 109 std::mt19937* rng_;
110 bool paused_ = false;
104}; 111};
105 112
106#endif /* end of include guard: GAME_H_E6F1396E */ 113#endif /* end of include guard: GAME_H_E6F1396E */