-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.cpp
More file actions
73 lines (53 loc) · 1.84 KB
/
Menu.cpp
File metadata and controls
73 lines (53 loc) · 1.84 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
#include "Menu.h"
void Menu::enterYourBoard()
{
clear_screen();
cout << "Enter your fileName" << endl;
cin >> userFileName;
}
void Menu::printSilentMessage(bool succesful) const
{
gotoxy(0, 0);
if (succesful)
cout << "Test passed" << endl;
else
cout << "Test failed"<<endl;
}
void Menu::printAndGetMenu()
{
clear_screen();
setTextColor(Color::WHITE);
std::cout << ">>>>>>>>>>>>>>>>>>>>>>> WELCOME TO PACAMAN <<<<<<<<<<<<<<<<<<<<<<<<<<<<\n" << endl
<< "1. Start a new game - Without colors" << endl
<< "2. Start a new game - With colors" << endl
<< "3. Start a new game - With the name of the board you want" << endl
<< "8. Present instructions and keys" << endl
<< "9. EXIT" << endl;
do {
cin >> choiceMenu;
if (choiceMenu != 1 && choiceMenu != 2 && choiceMenu != 3 && choiceMenu != 4 && choiceMenu != 8 && choiceMenu != 9)
cout << "WRONG INPUT. Please choose valid choice." << endl;
} while (choiceMenu != 1 && choiceMenu != 2 && choiceMenu != 3 && choiceMenu != 4 && choiceMenu != 8 && choiceMenu != 9);
}
void Menu::printAndGetLevelGhost()
{
clear_screen();
setTextColor(Color::WHITE);
cout << "Choose your level :" << endl
<< "1. Beginner" << endl
<< "2. Advanced" << endl
<< "3. Fully controled" << endl;
do {
cin >> choiceLevel;
if (choiceLevel != 1 && choiceLevel != 2 && choiceLevel != 3)
cout << "WRONG INPUT. Please choose valid level." << endl;
} while (choiceLevel != 1 && choiceLevel != 2 && choiceLevel != 3);
}
void Menu::printInstructions() const {
clear_screen();
do
{
cout << "Goal: \nGuide Pacman around the maze and eat all the little white dots whilst avoiding the ghosts." << endl
<< "\nKeys: \nW-up \nX-down \nD-right \nA-left \nS-stay in your place\n\nPress any key to go back to menu\n";
} while (!_getch());
}