From e5fc5bccff29bce3de09209707cf8dbe14a80b35 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 20 Mar 2022 20:14:46 -0400 Subject: control instructions --- src/game.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index 39828f4..98745f4 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -18,6 +18,7 @@ Game::Game(std::mt19937& rng, Muxer& muxer, Renderer& renderer) : { losePopLampTimer.accumulate(losePopLampTimer.getDt()); initialFade.start(1000); + helpProgress.start(1500); do { loadMap(); @@ -954,6 +955,44 @@ void Game::updatePlaying(size_t frameTime) { } } + switch (helpState) { + case HelpState::PreWait: { + helpProgress.tick(frameTime); + if (helpProgress.isComplete()) { + helpState = HelpState::FadeIn; + helpProgress.start(1000); + } + break; + } + case HelpState::FadeIn: { + helpProgress.tick(frameTime); + if (helpProgress.isComplete()) { + helpState = HelpState::Hold; + helpProgress.start(3000); + } + break; + } + case HelpState::Hold: { + helpProgress.tick(frameTime); + if (helpProgress.isComplete()) { + helpState = HelpState::FadeOut; + helpProgress.start(1000); + } + break; + } + case HelpState::FadeOut: { + helpProgress.tick(frameTime); + if (helpProgress.isComplete()) { + helpState = HelpState::Done; + } + break; + } + case HelpState::Done: { + // Do nothing. + break; + } + } + switch (signInstructionState) { case SignInstructionState::Hidden: { auto [lookX, lookY] = coordInDirection(player_x, player_y, playerAnim.getDirection()); -- cgit 1.4.1