diff options
author | Charadon <dev@iotib.net> | 2022-06-15 16:04:24 -0400 |
---|---|---|
committer | Charadon <dev@iotib.net> | 2022-06-15 16:04:24 -0400 |
commit | 9fe18929b324b2b35656b4027937a10e5e0a88fb (patch) | |
tree | 1aac0d9f07ef675a9fb1acaa99fe17bc9003d532 /src | |
parent | 283fb7c5502f3bd07094f25d0aec84d402cf656f (diff) | |
download | Pong-C-9fe18929b324b2b35656b4027937a10e5e0a88fb.tar.gz |
More control stuff
Diffstat (limited to 'src')
-rw-r--r-- | src/title.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/title.c b/src/title.c index 713b2c0..f44e71f 100644 --- a/src/title.c +++ b/src/title.c @@ -428,8 +428,8 @@ int title_screen() { } else if(IsGamepadButtonPressed(0, GAMEPAD_BUTTON_LEFT_FACE_UP) || IsKeyPressed(KEY_W)) { Choice--; } - if(Choice > 5) { - Choice = 5; + if(Choice > 4) { + Choice = 4; } else if(Choice < 0) { Choice = 0; } @@ -444,26 +444,30 @@ int title_screen() { if (CheckCollisionRecs(Mouse, Versus) || Choice == 0) { Selected = &Versus; + Choice = 0; if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT) || IsKeyPressed(KEY_SPACE) || IsGamepadButtonPressed(0, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) { TitleScreenGoing = false; - Choice = 0; } - } else if (CheckCollisionRecs(Mouse, Marathon) || Choice == 1) { + } + if (CheckCollisionRecs(Mouse, Marathon) || Choice == 1) { Selected = &Marathon; + Choice = 1; if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT) || IsKeyPressed(KEY_SPACE) || IsGamepadButtonPressed(0, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) { TitleScreenGoing = false; - Choice = 1; } - } else if (CheckCollisionRecs(Mouse, Settings) || Choice == 2) { + } + if (CheckCollisionRecs(Mouse, Settings) || Choice == 2) { Selected = &Settings; + Choice = 2; if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT) || IsKeyPressed(KEY_SPACE) || IsGamepadButtonPressed(0, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) { settings(&MainCamera, TitleMusic); - Choice = 2; } - } else if (CheckCollisionRecs(Mouse, Help) || Choice == 3) { + } + if (CheckCollisionRecs(Mouse, Help) || Choice == 3) { Selected = &Help; Choice = 3; - } else if (CheckCollisionRecs(Mouse, Exit) || Choice == -1) { + } + if (CheckCollisionRecs(Mouse, Exit) || Choice == 4) { Selected = &Exit; Choice = 4; if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) { |