diff options
-rw-r--r-- | src/main.c | 5 | ||||
-rw-r--r-- | src/title.c | 18 |
2 files changed, 14 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c index 6b07e4e..c25de51 100644 --- a/src/main.c +++ b/src/main.c @@ -1,4 +1,5 @@ #include "pong.h" +#include <raylib.h> int Difficulty = 1; SDL_atomic_t Ticks; @@ -66,6 +67,10 @@ static int internal_clock() { SDL_AtomicAdd(&Ticks, 1); DeltaTime--; } + /* This will make sure no matter where you are in the game, it will close when it should. */ + if (WindowShouldClose()) { + GameGoing = false; + } } return(0); diff --git a/src/title.c b/src/title.c index f909a9e..5a5fecc 100644 --- a/src/title.c +++ b/src/title.c @@ -147,16 +147,16 @@ static void score_screen(Camera2D *MainCamera) { ClearBackground(BLACK); BeginMode2D(*MainCamera); DrawRectangle(0, 0, 1280, 720, (Color){20, 20, 20, 255}); - /* Scores */ - int a = 0; - int i = 0; - for (i = 1+(10*Page); i <= 10+(10*Page); i++, a++) { + /* Scores */ + int a = 0; + int i = 0; + for (i = 1+(10*Page); i <= 10+(10*Page); i++, a++) { if(Scores[i-1]->Name[0] != ' ') { - DrawText(TextFormat("%d. %s: %d", i, Scores[i-1]->Name, Scores[i-1]->Score), 460, 60+(50*a), 48, WHITE); - } else { - EndOfPages = true; - } - } + DrawText(TextFormat("%d. %s: %d", i, Scores[i-1]->Name, Scores[i-1]->Score), 460, 60+(50*a), 48, WHITE); + } else { + EndOfPages = true; + } + } /* Page Buttons */ if(CheckCollisionRecs(MouseCursor, PrevPage) && Page > 0) { DrawRectangleRec(PrevPage, RED); |