From 514b240348a7c401fa6725ae74540d5f3ee29cfb Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 19 Mar 2022 21:07:50 -0400 Subject: added fade in to new game and fixed music on new game --- src/game.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/game.cpp') 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) : sign(renderer.getFont()) { losePopLampTimer.accumulate(losePopLampTimer.getDt()); + initialFade.start(1000); do { loadMap(); @@ -846,6 +847,19 @@ void Game::updatePlaying(size_t frameTime) { switch (losing) { + case LoseState::NewGame: + { + if (!startedMusic) { + startedMusic = true; + muxer.startMusic(); + } + initialFade.tick(frameTime); + if (initialFade.isComplete()) { + losing = LoseState::None; + } + break; + } + case LoseState::None: { if (moving) { -- cgit 1.4.1