diff options
Diffstat (limited to 'src/versus.c')
-rw-r--r-- | src/versus.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/versus.c b/src/versus.c index 6d964de..cd57d9a 100644 --- a/src/versus.c +++ b/src/versus.c @@ -42,7 +42,13 @@ void versus_main() { MainCamera.target = (Vector2){0, 0}; MainCamera.offset = (Vector2){0, 0}; MainCamera.rotation = 0; - while(!WindowShouldClose() && GameGoing == true) { + bool VersusGoing = true; + while(VersusGoing == true && GameGoing == true) { + + if (WindowShouldClose()) { //Quit Game if the window is closed. + GameGoing = false; + } + UpdateMusicStream(Background); MainCamera.zoom = GetScreenHeight()/720.0f; MainCamera.offset = (Vector2){GetScreenWidth()/2.0f, GetScreenHeight()/2.0f}; @@ -85,6 +91,11 @@ void versus_main() { } else if(IsMouseButtonPressed(MOUSE_BUTTON_LEFT) || IsCursorHidden() == true) { Player.Y = GetMouseY()-PaddleSprite.height/2.0f; DisableCursor(); + } + + // Leave Game + if(IsKeyPressed(KEY_Q)) { + return; } if(GetMouseY() < 0) { |