about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/title.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/title.c b/src/title.c
index 25e0112..808885a 100644
--- a/src/title.c
+++ b/src/title.c
@@ -144,7 +144,7 @@ static void score_screen(Camera2D *MainCamera) {
                     }
                 }
 		// Page Buttons
-		if(CheckCollisionRecs(MouseCursor, PrevPage)) {
+		if(CheckCollisionRecs(MouseCursor, PrevPage) && Page > 0) {
 			DrawRectangleRec(PrevPage, RED);
 			if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) {
 				if(Page > 0) {
@@ -161,15 +161,20 @@ static void score_screen(Camera2D *MainCamera) {
 		}
                 DrawText("<--", 5, 720-50, 48, WHITE);
                 DrawText("-->", 1280-70, 720-50, 48, WHITE);
+		//Exit Button
+		if(CheckCollisionRecs(MouseCursor, (Rectangle){0,0,42,120})) {
+			DrawRectangle(0, 0, 42, 120, RED);
+			if(IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) {
+				LookingAtScores = false;
+			}
+		}
+		DrawText("<", 0, 0, 128, WHITE);
 		// Cursor
                 DrawTexture(MouseCursorSprite, MouseCursor.x, MouseCursor.y, WHITE);
             EndMode2D();
         EndDrawing();
-        if(IsKeyPressed(KEY_Q)) {
-            return;
-        }
     }
-    
+    return;
 }
 
 static void settings(Camera2D *MainCamera, Mix_Music *TitleScreenMusic) {
@@ -461,7 +466,7 @@ int title_screen() {
                     }
                     char LeaderboardText[1024];
                     for (int i = 1; i <= 10; i++) {
-                        if(Top10[i-1].Name[0] != ' ') {
+                        if(Top10[i-1].Name[0] != '\0') { //If name is blank, that means we're at the end of the list.
                             snprintf(LeaderboardText, sizeof(LeaderboardText), "%d: %s : %d", i, Top10[i-1].Name, Top10[i-1].Score);
                             DrawText(LeaderboardText, 600, 50*i, 48, WHITE);
                         }