summary refs log tree commit diff stats
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp39
1 files changed, 39 insertions, 0 deletions
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) :
18{ 18{
19 losePopLampTimer.accumulate(losePopLampTimer.getDt()); 19 losePopLampTimer.accumulate(losePopLampTimer.getDt());
20 initialFade.start(1000); 20 initialFade.start(1000);
21 helpProgress.start(1500);
21 22
22 do { 23 do {
23 loadMap(); 24 loadMap();
@@ -954,6 +955,44 @@ void Game::updatePlaying(size_t frameTime) {
954 } 955 }
955 } 956 }
956 957
958 switch (helpState) {
959 case HelpState::PreWait: {
960 helpProgress.tick(frameTime);
961 if (helpProgress.isComplete()) {
962 helpState = HelpState::FadeIn;
963 helpProgress.start(1000);
964 }
965 break;
966 }
967 case HelpState::FadeIn: {
968 helpProgress.tick(frameTime);
969 if (helpProgress.isComplete()) {
970 helpState = HelpState::Hold;
971 helpProgress.start(3000);
972 }
973 break;
974 }
975 case HelpState::Hold: {
976 helpProgress.tick(frameTime);
977 if (helpProgress.isComplete()) {
978 helpState = HelpState::FadeOut;
979 helpProgress.start(1000);
980 }
981 break;
982 }
983 case HelpState::FadeOut: {
984 helpProgress.tick(frameTime);
985 if (helpProgress.isComplete()) {
986 helpState = HelpState::Done;
987 }
988 break;
989 }
990 case HelpState::Done: {
991 // Do nothing.
992 break;
993 }
994 }
995
957 switch (signInstructionState) { 996 switch (signInstructionState) {
958 case SignInstructionState::Hidden: { 997 case SignInstructionState::Hidden: {
959 auto [lookX, lookY] = coordInDirection(player_x, player_y, playerAnim.getDirection()); 998 auto [lookX, lookY] = coordInDirection(player_x, player_y, playerAnim.getDirection());