From b99e5b1d2c6ccef7e9a714d2d4bcef050b99ff01 Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Tue, 4 Jan 2022 14:41:22 +0100 Subject: start menu and retry --- src/main.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 20a6cdc..0912639 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,3 +1,12 @@ +/*********************************/ +/* THRESHOLD ( // */ +/* main ( )/ */ +/* by salade )(/ */ +/* ________________ ( /) */ +/* ()__)____________))))) :^} */ +/*********************************/ + + #include "window.hpp" #include "gameplay.hpp" #include @@ -28,6 +37,10 @@ int main(void) { } case (ENDING): { + if (IsKeyPressed(KEY_ENTER)) + { + gs = TITLE; + } break ; } } @@ -38,18 +51,22 @@ int main(void) { switch (gs) { case (TITLE): { - DrawText("LOGO SCREEN", 20, 20, 40, LIGHTGRAY); + DrawText("THRESHOLD", (SCREENWIDTH / 2) - 150, SCREENHEIGHT / 2, 40, RED); + DrawText("PRESS ENTER", (SCREENWIDTH / 2) - 150, (SCREENHEIGHT / 2) + 50, 40, MAROON); break ; } case (GAMEPLAY): { - game->getKeys(); + if (game->getKeys()) { + gs = ENDING; + } game->draw(); break ; } case (ENDING): { - DrawText("GOOD BYE SCREEN", 20, 20, 40, LIGHTGRAY); + DrawCircle(SCREENWIDTH / 2, SCREENHEIGHT / 2, 200, BLACK); + DrawText("GOOD BYE", (SCREENWIDTH / 2) - 100, SCREENHEIGHT / 2, 40, WHITE); break ; } } -- cgit v1.2.3