diff --git a/olcCodeJam2023Entry/VirusAttack.cpp b/olcCodeJam2023Entry/VirusAttack.cpp index eccf54b..4d60ac5 100644 --- a/olcCodeJam2023Entry/VirusAttack.cpp +++ b/olcCodeJam2023Entry/VirusAttack.cpp @@ -688,6 +688,12 @@ bool VirusAttack::OnUserUpdate(float fElapsedTime){ #pragma region MAIN_MENU case GameState::MAIN_MENU:{ mainMenu.Update(this); + + if(campaignStartButton->bPressed){ + state=GameState::GAMEPLAY; + RestartLevel(); + } + titleScreenY=std::min(0.f,titleScreenY+fElapsedTime*120); nextColorChange=std::max(0.f,nextColorChange-fElapsedTime); transition=std::min(1.f,transition+fElapsedTime); diff --git a/olcCodeJam2023Entry/VirusAttack.h b/olcCodeJam2023Entry/VirusAttack.h index fd864bc..f0d4154 100644 --- a/olcCodeJam2023Entry/VirusAttack.h +++ b/olcCodeJam2023Entry/VirusAttack.h @@ -111,7 +111,7 @@ private: bool reloadLevel=false; bool restartButtonHeldDown=false; float restartButtonHoldTime=0; - GameState state=GameState::MAIN_MENU; + GameState state=GameState::GAMEPLAY; float nextColorChange=10; std::arraycolorChangeOptions={VERY_DARK_BLUE,VERY_DARK_CYAN,VERY_DARK_GREEN,VERY_DARK_GREY,VERY_DARK_MAGENTA,VERY_DARK_RED,VERY_DARK_YELLOW}; Pixel currentBackCol;