-
Notifications
You must be signed in to change notification settings - Fork 0
/
graphics.h
122 lines (98 loc) · 6.15 KB
/
graphics.h
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#ifndef GRAPHICS_H
#define GRAPHICS_H
#include "Structs/World.h"
#include "Structs/Vec2.h"
#include "raylib.h"
#define SCREEN_WIDTH 1280
#define SCREEN_HEIGHT 720
#define GAME_OVER_LABEL ((Rectangle) {.x = SCREEN_WIDTH/2 - 300/2, \
.y = SCREEN_HEIGHT/2 - 50, \
.width = 300, \
.height = 50})
#define GAME_OVER_SCORE_LABEL ((Rectangle) {.x = SCREEN_WIDTH/2 - 300/2, \
.y = GAME_OVER_LABEL.y + GAME_OVER_LABEL.height, \
.width = 300, \
.height = 50})
#define GAME_OVER_BUTTON ((Rectangle) {.x = SCREEN_WIDTH/2 - 300/2, \
.y = GAME_OVER_SCORE_LABEL.y + GAME_OVER_SCORE_LABEL.height, \
.width = 300, \
.height = 50})
#define GAME_OVER_MENU_BUTTON ((Rectangle) {.x = SCREEN_WIDTH/2 - 300/2, \
.y = GAME_OVER_BUTTON.y + GAME_OVER_BUTTON.height + 10, \
.width = 300, \
.height = 50})
#define MAIN_MENU_TITLE_LABEL ((Rectangle) {.x = SCREEN_WIDTH/2 - 300/2, \
.y = 50, \
.width = 300, \
.height = 50})
#define MAIN_MENU_START_BUTTON ((Rectangle) {.x = SCREEN_WIDTH/2 - 300/2, \
.y = MAIN_MENU_TITLE_LABEL.y + 150, \
.width = 300, \
.height = 50})
#define MAIN_MENU_LOAD_BUTTON ((Rectangle) {.x = SCREEN_WIDTH/2 - 300/2, \
.y = MAIN_MENU_START_BUTTON.y + 75, \
.width = 300, \
.height = 50})
#define MAIN_MENU_HISCORE_BUTTON ((Rectangle) {.x = SCREEN_WIDTH/2 - 300/2, \
.y = MAIN_MENU_LOAD_BUTTON.y + 75, \
.width = 300, \
.height = 50})
#define MAIN_MENU_EXIT_BUTTON ((Rectangle) {.x = SCREEN_WIDTH/2 - 300/2, \
.y = MAIN_MENU_HISCORE_BUTTON.y + 75, \
.width = 300, \
.height = 50})
#define PAUSE_MENU_LABEL ((Rectangle) {.x = SCREEN_WIDTH/2 - 300/2, \
.y = 50, \
.width = 300, \
.height = 50})
#define PAUSE_MENU_RESUME_BUTTON ((Rectangle) {.x = SCREEN_WIDTH/2 - 300/2, \
.y = PAUSE_MENU_LABEL.y + 150, \
.width = 300, \
.height = 50})
#define PAUSE_MENU_SAVE_BUTTON ((Rectangle) {.x = SCREEN_WIDTH/2 - 300/2, \
.y = PAUSE_MENU_RESUME_BUTTON.y + 75, \
.width = 300, \
.height = 50})
#define PAUSE_MENU_EXIT_BUTTON ((Rectangle) {.x = SCREEN_WIDTH/2 - 300/2, \
.y = PAUSE_MENU_SAVE_BUTTON.y + 75, \
.width = 300, \
.height = 50})
#define ASK_NAME_LABEL ((Rectangle) { .x = SCREEN_WIDTH/2 - 1000/2, \
.y = 100, \
.width = 1000, \
.height = 50})
#define ASK_NAME_INPUT_BOX ((Rectangle) {.x = SCREEN_WIDTH/2 - 300/2, \
.y = ASK_NAME_LABEL.y + 100, \
.width = 300, \
.height = 50})
#define ASK_NAME_CONFIRM_BUTTON ((Rectangle) {.x = SCREEN_WIDTH/2 - 300/2, \
.y = ASK_NAME_INPUT_BOX.y + 100, \
.width = 300, \
.height = 50})
#define HIGH_SCORE_LABEL ((Rectangle) { .x = SCREEN_WIDTH/2 - 300/2, \
.y = 50, \
.width = 300, \
.height = 50})
#define HIGH_SCORE_BACK_BUTTON ((Rectangle) { .x = 0, \
.y = SCREEN_HEIGHT - 50, \
.width = 100, \
.height = 50})
Camera2D getCam();
void setIsRunning(int);
void initGraphics();
void drawWorld(World);
void endGraphics();
int isGraphicsRunning();
Vector2 vec2ToVector2(Vec2);
void drawCircle(Ball, Color, char*);
void drawPlaying(World, int);
void drawGameOver(World);
Rectangle centerText(Rectangle, char*, int);
Color complementaryColor(Color);
void drawMainMenu(World);
void drawButton(char*, Rectangle, Color, int);
void drawPauseMenu(World);
void drawAskName(World);
void drawHighScoreScreen(World);
void drawLabel(World);
#endif // GRAPHICS_H