-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgameOverMenu.c
More file actions
59 lines (48 loc) · 2.2 KB
/
gameOverMenu.c
File metadata and controls
59 lines (48 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*******************************************************************************************
*
* Smurf Invaders. Technical Demo as an explorative project of Raylib.
* Random game based on Space Invaders and alike.
*
* Copyright (c) 2020 Oscar Lostes Cazorla, under MIT license.
*
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* Raylib by Ramon Santamaria (@raysan5), Copyright (c) 2013-2020
*
********************************************************************************************/
#include "gameOverMenu.h"
State gameOverMenu()
{
// Initialization
//--------------------------------------------------------------------------------------
// Initaize HUD displays
//TextCopy(healthDisp, TextFormat("LIVES: %d", health));
//TextCopy(scoreDisp, TextFormat("SCORE: %d", score));
//--------------------------------------------------------------------------------------
// Main game loop
while (true) // Detect window close button or ESC key. Dummy exit on player killed
{
// Update
//----------------------------------------------------------------------------------
if (IsKeyPressed(KEY_ENTER)) return GAME;
if (IsKeyPressed(KEY_ESCAPE)) return MAIN_M;
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
{
ClearBackground(RAYWHITE); // Clear background
// Menu drawing
DrawText("GAME OVER!", screenWidth / 2 - MeasureText("GAME OVER!", 40) / 2, screenHeight / 2 - 70, 40, GREEN);
DrawText("Press ENTER to play again", screenWidth / 2 - MeasureText("Press ENTER to play again", 20) / 2,
screenHeight / 2, 20, BLUE);
DrawText("Press ESCAPE to return main menu", screenWidth / 2 - MeasureText("Press ESCAPE to return main menu", 20) / 2,
screenHeight / 2 + 40, 20, BLUE);
}
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------
return EXIT;
}