2022-06-12 17:49:42 +00:00
|
|
|
/*
|
|
|
|
- Avoid ~ a game by Canneddonuts
|
|
|
|
- Filename ~ Gameover.c
|
|
|
|
- Author ~ Return0ne
|
|
|
|
- 2022
|
|
|
|
- *no license*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "../include/raylib.h"
|
|
|
|
|
|
|
|
#include "Screens.h"
|
|
|
|
#include "Controls.h"
|
|
|
|
|
|
|
|
int gameoverSelected = 0;
|
|
|
|
|
|
|
|
void InitGameoverScreen(void)
|
|
|
|
{
|
|
|
|
gameoverSelected = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void UpdateGameoverScreen(void)
|
|
|
|
{
|
|
|
|
if (INPUT_UP_PRESSED) gameoverSelected++;
|
|
|
|
if (INPUT_DOWN_PRESSED) gameoverSelected--;
|
|
|
|
if (gameoverSelected > 0) gameoverSelected--;
|
|
|
|
if (gameoverSelected < -1) gameoverSelected++;
|
|
|
|
|
|
|
|
if ((gameoverSelected == 0) && (INPUT_OPTION_PRESSED))
|
|
|
|
currentScreen = GAMEPLAY;
|
|
|
|
|
|
|
|
if ((gameoverSelected == -1) && (INPUT_OPTION_PRESSED))
|
|
|
|
currentScreen = TITLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DrawGameoverScreen(void)
|
|
|
|
{
|
2022-06-17 02:17:26 +00:00
|
|
|
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), BLACK);
|
2022-06-12 17:49:42 +00:00
|
|
|
DrawText("GAMEOVER", 250, 20, 50, RED);
|
|
|
|
if (gameoverSelected == 0) DrawText("RETRY", 350, 200, 20, WHITE);
|
|
|
|
else DrawText("RETRY", 350, 200, 20, RED);
|
|
|
|
|
|
|
|
if (gameoverSelected == -1) DrawText("TITLE", 352, 230, 20, WHITE);
|
|
|
|
else DrawText("TITLE", 352, 230, 20, RED);
|
|
|
|
}
|