diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-19 21:07:50 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-19 21:07:50 -0400 |
commit | 514b240348a7c401fa6725ae74540d5f3ee29cfb (patch) | |
tree | 6c4dd02b3aacc1bf57f8e4c2b2b46ed34fa73fdd /src/game.cpp | |
parent | 5c92093bd82b54e79c63937cb0dbefabc5f47624 (diff) | |
download | ether-514b240348a7c401fa6725ae74540d5f3ee29cfb.tar.gz ether-514b240348a7c401fa6725ae74540d5f3ee29cfb.tar.bz2 ether-514b240348a7c401fa6725ae74540d5f3ee29cfb.zip |
added fade in to new game
and fixed music on new game
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp index 72bcbfa..caa465c 100644 --- a/src/game.cpp +++ b/src/game.cpp | |||
@@ -16,6 +16,7 @@ Game::Game(std::mt19937& rng, Muxer& muxer, Renderer& renderer) : | |||
16 | sign(renderer.getFont()) | 16 | sign(renderer.getFont()) |
17 | { | 17 | { |
18 | losePopLampTimer.accumulate(losePopLampTimer.getDt()); | 18 | losePopLampTimer.accumulate(losePopLampTimer.getDt()); |
19 | initialFade.start(1000); | ||
19 | 20 | ||
20 | do { | 21 | do { |
21 | loadMap(); | 22 | loadMap(); |
@@ -846,6 +847,19 @@ void Game::updatePlaying(size_t frameTime) { | |||
846 | 847 | ||
847 | switch (losing) | 848 | switch (losing) |
848 | { | 849 | { |
850 | case LoseState::NewGame: | ||
851 | { | ||
852 | if (!startedMusic) { | ||
853 | startedMusic = true; | ||
854 | muxer.startMusic(); | ||
855 | } | ||
856 | initialFade.tick(frameTime); | ||
857 | if (initialFade.isComplete()) { | ||
858 | losing = LoseState::None; | ||
859 | } | ||
860 | break; | ||
861 | } | ||
862 | |||
849 | case LoseState::None: | 863 | case LoseState::None: |
850 | { | 864 | { |
851 | if (moving) { | 865 | if (moving) { |