summary refs log tree commit diff stats
path: root/src/title.c
diff options
context:
space:
mode:
authorCharadon <dev@iotib.net>2022-06-02 12:09:14 -0400
committerCharadon <dev@iotib.net>2022-06-02 12:09:14 -0400
commite372341eb2d92ee7df6fcaf43f4dc2a27967e390 (patch)
tree0454572596e26e5c94bdb0ffba88e0e6edc08a76 /src/title.c
parent66881a0a3136c871fb0c58aa31be174c60bcf118 (diff)
downloadPong-C-e372341eb2d92ee7df6fcaf43f4dc2a27967e390.tar.gz
Seperated versus mode from main.c
Diffstat (limited to 'src/title.c')
-rw-r--r--src/title.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/title.c b/src/title.c
index 1f2a51d..56e382c 100644
--- a/src/title.c
+++ b/src/title.c
@@ -4,7 +4,8 @@ void help_text() {
 
 }
 
-void title_screen() {
+int title_screen() {
+    // Init Camera
     Camera2D MainCamera;
     MainCamera.offset = (Vector2){0,0};
     MainCamera.target = (Vector2){0,0};
@@ -38,7 +39,7 @@ void title_screen() {
         if (CheckCollisionRecs(Mouse, Versus)) {
             Selected = &Versus;
             if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) {
-                return; 
+                return 0; 
             }
         } else if (CheckCollisionRecs(Mouse, Marathon)) {
             Selected = &Marathon;
@@ -50,7 +51,7 @@ void title_screen() {
             Selected = &Exit;
             if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) {
                 GameGoing = false;
-                return;
+                return -1;
             }
         }
         BeginDrawing();
@@ -67,5 +68,5 @@ void title_screen() {
             EndMode2D();
         EndDrawing();
     }
-    return;
+    return -1;
 }