From 62f5fe938ec4c379b38db2a963488f5278cdfc36 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sat, 2 Sep 2023 18:27:34 -0500 Subject: [PATCH] ??? --- olcCodeJam2023Entry/VirusAttack.cpp | 6 ++++++ olcCodeJam2023Entry/VirusAttack.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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;