summary refs log tree commit diff stats
path: root/src/title.c
diff options
context:
space:
mode:
authorCharadon <dev@iotib.net>2022-06-02 18:39:29 -0400
committerCharadon <dev@iotib.net>2022-06-02 18:39:29 -0400
commitd1d13216310c7ebb23f99459e21905393d02b839 (patch)
treef70eee8aa27cf25e90e08aec1c930413df87c5c8 /src/title.c
parent2dd8b8b6e66aa7e47da42912b0ca07ed8d7f0c23 (diff)
downloadPong-C-0.2.tar.gz
Fixed some bugs and a segfault v0.2
Diffstat (limited to 'src/title.c')
-rw-r--r--src/title.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/title.c b/src/title.c
index 7617a7c..d53db5a 100644
--- a/src/title.c
+++ b/src/title.c
@@ -34,7 +34,13 @@ int title_screen() {
     Rectangle *Selected;
     Selected = &Versus;
     EnableCursor();
-    while(!WindowShouldClose() && TitleScreenGoing == true) {
+    while(TitleScreenGoing == true && GameGoing == true) {
+        
+        if (WindowShouldClose()) { //Quit Game if the window is closed.
+            GameGoing = false;
+            TitleScreenGoing = false;
+        }
+
         MainCamera.zoom = GetScreenHeight()/720.0f;
         Mouse.x = GetMouseX()/MainCamera.zoom;
         Mouse.y = GetMouseY()/MainCamera.zoom;
@@ -70,7 +76,7 @@ int title_screen() {
                 DrawText("Help", 20, 300, 48, WHITE);
                 DrawText("Exit", 20, 350, 48, WHITE);
             EndMode2D();
-            DrawText(VersionString, GetScreenWidth()-200, GetScreenHeight()-32, 32, GREEN);
+            DrawText(VersionString, GetScreenWidth()-400, GetScreenHeight()-32, 32, GREEN);
         EndDrawing();
     }
     return -1;