-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtility.cpp
More file actions
50 lines (46 loc) · 1.08 KB
/
Utility.cpp
File metadata and controls
50 lines (46 loc) · 1.08 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
#include "Utility.h"
void InitializeSettings() {
SetConsoleOutputCP( 65001 );
system("title Rogueliek Rogulik Guguglik");
//system("mode con cols=129 lines=32");
}
void gotoxy(int x, int y)
{
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
void wait() {
int a;
cin >> a;
}
int KeyCheck(int Key) {
if (Key == 'w' or Key == 'W' or Key == 230 or Key == 150) {
return 1;
}
if (Key == 'a' or Key == 'A' or Key == 228 or Key == 148) {
return 2;
}
if (Key == 's' or Key == 'S' or Key == 235 or Key == 155) {
return 3;
}
if (Key == 'd' or Key == 'D' or Key == 162 or Key == 130) {
return 4;
}
if (Key == 13){
return 5;
}
if (Key == 'e' or Key == 'E' or Key == 227 or Key == 147) {
return 6;
}
if (Key == 'i' or Key == 'I' or Key == 232 or Key == 152) {
return 7;
}
if (Key == 27) {
return 8;
}
}
int Random(int First, int Second) {
return (First + (rand() % (First + Second + 1)));
}