-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserInterface.cpp
More file actions
162 lines (152 loc) · 3.7 KB
/
UserInterface.cpp
File metadata and controls
162 lines (152 loc) · 3.7 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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#include "UserInterface.h"
#include "Utility.h"
#include "PlayerItems.h"
//using namespace std;
/*
*/
int UserInterface::StartMenu() {
int flag = 0;
int choice = 0;
TurnBrightAqua;
if (KeyCheck(6)) {
gotoxy(0, 30);
for (int i = 0; i < 120; i++) {
gotoxy(0 + i, 0);
cout << "▀";
gotoxy(0 + i, 29);
cout << "▄";
}
for (int i = 0; i < 30; i++) {
gotoxy(0, i);
cout << "█";
gotoxy(119, i);
cout << "█";
}
}
gotoxy(5, 5);
cout<< "SUPER DUPER ROGULIKE 2001 MINI XS MAX 3310 PRO ELITE EXPERIENCE ROYAL 1.6 DELUXE VERSION EDITION 1ST GENERATION";
TurnWhite;
gotoxy(60, 24);
cout << "EXIT";
TurnBrightAqua;
gotoxy(60, 14);
cout << "START";
gotoxy(64, 14);
TurnWhite;
while (true) {
int Key = _getch();
if (KeyCheck(Key) == 1) {
TurnWhite;
gotoxy(60, 24);
cout << "EXIT";
TurnBrightAqua;
gotoxy(60, 14);
cout << "START";
gotoxy(64, 14);
TurnWhite;
flag=0;
} else if (KeyCheck(Key) == 3) {
TurnWhite;
gotoxy(60, 14);
cout << "START";
TurnBrightAqua;
gotoxy(60, 24);
cout << "EXIT";
gotoxy(63, 24);
TurnWhite;
flag=1;
}
if (flag == 0 and KeyCheck(Key) == 5) {
system("cls");
return choice;
} else if (flag == 1 and KeyCheck(Key) == 5) {
exit(0);
}
}
}
string UserInterface::ClassMenu() {
int flag = 0;
string choice;
TurnAqua;
if (KeyCheck(6)) {
gotoxy(0, 30);
for (int i = 0; i < 120; i++) {
gotoxy(0 + i, 0);
cout << "▀";
gotoxy(0 + i, 29);
cout << "▄";
}
for (int i = 0; i < 30; i++) {
gotoxy(0, i);
cout << "█";
gotoxy(119, i);
cout << "█";
}
}
gotoxy(50, 5);
cout << "SELECT CHARACTER`S CLASS";
TurnWhite;
gotoxy(60, 24);
cout << "ARCHER";
TurnAqua;
gotoxy(60, 14);
cout << "KNIGHT";
gotoxy(64, 14);
TurnWhite;
while (true) {
int Key = _getch();
if (KeyCheck(Key) == 1) {
TurnWhite;
gotoxy(60, 24);
cout << "ARCHER";
TurnAqua;
gotoxy(60, 14);
cout << "KNIGHT";
gotoxy(64, 14);
TurnWhite;
flag=0;
} else if (KeyCheck(Key) == 3) {
TurnWhite;
gotoxy(60, 14);
cout << "KNIGHT";
TurnAqua;
gotoxy(60, 24);
cout << "ARCHER";
gotoxy(63, 24);
TurnWhite;
flag=1;
}
if (flag == 0 and KeyCheck(Key) == 5) {
system("cls");
return "Knight";
} else if (flag == 1 and KeyCheck(Key) == 5) {
system("cls");
return "Archer";
}
}
}
void DrawGUI(int Health, int Stamina, int Armor, int Damage, int Gold) {
gotoxy(8, 0);
cout << "HP:" << Health;
TurnBrightAqua;
gotoxy(15, 0);
cout << "STM:" << Stamina;
TurnMagenta;
gotoxy(23, 0);
cout << "ARM:" << Armor;
TurnLightRed;
gotoxy(31, 0);
cout << "DMG:" << Damage;
TurnYellow;
gotoxy(40, 0);
cout << "GOLD:" << Gold;
TurnMagenta;
gotoxy(50, 0);
cout << "Press I to open inventory, Press E to interact with something";
}
void ShowXY(int x, int y) {
gotoxy(0, 28);
cout << " ";
gotoxy(0, 28);
cout << x << " " << y;
}