diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2022-01-11 16:19:57 +0100 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2022-01-11 16:19:57 +0100 |
commit | 00aaef95323c01f6575e497921595b68da52fd2f (patch) | |
tree | c568a4a6c2f140ce1e93ba6c433d0a6eb6467b67 /src/main.cpp | |
parent | cool man. death is fucked yo (diff) | |
download | threshold-00aaef95323c01f6575e497921595b68da52fd2f.tar.gz threshold-00aaef95323c01f6575e497921595b68da52fd2f.tar.bz2 threshold-00aaef95323c01f6575e497921595b68da52fd2f.tar.xz threshold-00aaef95323c01f6575e497921595b68da52fd2f.tar.zst threshold-00aaef95323c01f6575e497921595b68da52fd2f.zip |
mouselook just needed some sleep ! cool
Diffstat (limited to '')
-rw-r--r-- | src/main.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/main.cpp b/src/main.cpp index 24916f1..a2f616d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -69,18 +69,14 @@ int main(void) { } case (DEATH): { - std::string current; - if (game != nullptr) - { - current = game->getCurrent(); + if (IsKeyPressed(KEY_ENTER)) { + auto current = game->getCurrent(); + delete game; + CloseAudioDevice(); + game = new Game(current); + gs = GAMEPLAY; } - - if (IsKeyPressed(KEY_ENTER)) { - CloseAudioDevice(); - game = new Game(current); - gs = GAMEPLAY; - } break ; } case (GAMEPLAY): @@ -121,6 +117,7 @@ int main(void) { ClearBackground(COOLPURPLE); + switch (gs) { case (TITLE): { @@ -153,6 +150,7 @@ int main(void) { DrawCircle(SCREENWIDTH / 2, SCREENHEIGHT / 2, 200, BLACK); DrawText("YOU DIED", (SCREENWIDTH / 2) - 200, (SCREENHEIGHT / 2) - 50, 40, WHITE); DrawText(game->getCurrent().c_str(), (SCREENWIDTH / 2) - 100, (SCREENHEIGHT / 2) + 50, 40, WHITE); + break ; } case (GAMEPLAY): { @@ -162,6 +160,7 @@ int main(void) { else if (code == 2) // level end {gs = NEXT;} } + BeginMode2D(game->cam); game->draw(); break ; } @@ -182,7 +181,6 @@ int main(void) { } EndDrawing(); } - EndMode2D(); CloseWindow(); return 0; } |