-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
63 lines (54 loc) · 1.06 KB
/
main.c
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
#include "entities/player.h"
#include "game/game.h"
#include "util/util.h"
#include <stdlib.h>
void start_game();
void load_game();
void show_instructions();
void quit_game();
int main()
{
menu:
type_with_color(COLOR_RED, "=== Welcome to %d Centum ===\n", 100);
type("1. Start Game\t");
type("2. Continue\t");
type("3. Instructions\t");
type("4. Quit\n");
int choice = get_input_int(4);
switch (choice) {
case 1:
start_game();
break;
case 2:
load_game();
break;
case 3:
show_instructions();
goto menu;
break;
case 4:
quit_game();
break;
}
return 0;
}
void start_game()
{
type("\nStarting the game...\n");
type("Prepare for adventure!\n\n");
Player* p = pl_create("Leigh");
g_start(p);
}
void load_game() { type("\nLoading game unavailable\n"); }
void show_instructions()
{
type("\n=== Instructions ===\n");
type("1. Navigate the dungeon using menu choices.\n");
type("2. Fight enemies and solve puzzles.\n");
type("3. Manage your inventory and survive.\n\n");
}
void quit_game()
{
type("\nThank you for playing! Goodbye!\n");
exit(0);
}