Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#include <iostream>
#include <cstdlib>
#include <string>
#include <conio.h>
#include <windows.h>
#include "GamePanel.h"
using namespace std;
int main()
{
HANDLE hConsole;
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
//SET color
SetConsoleTextAttribute
(hConsole, FOREGROUND_RED | FOREGROUND_GREEN);
cout << R"(
,---. | |
|---',---.,---.. .,---. | ,---.,---.,---.,---.,---|,---.
| \ | || || ||---' | |---'| ||---'| || |`---.
` ``---'`---|`---'`---' `---'`---'`---|`---'` '`---'`---'
`---' `---'
)" << endl;
//Set color back to normal
SetConsoleTextAttribute
(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
//Game Menu
cout << " ########################## " << endl;
cout << " # MENU : # " << endl;
cout << " #------------------------# " << endl;
cout << " #1.How to play this game # " << endl;
cout << " #------------------------# " << endl;
cout << " #2.Start the game # " << endl;
cout << " #------------------------# " << endl;
cout << " #3.Quit the game # " << endl;
cout << " ########################## " << endl;
//Choose Mini menu option
cout << "Choose which option do you want." << endl;
int choice;
cin >> choice;
//IF CHOICE = 1 SAY INSTRUCTIONS AND AFTER PLAY GAME OR EXIT
if (choice == 1) {
cout << "To play this game all you have to do is type and make sure you use the right commands" << endl;
cin >> choice;
if (choice == 2) {
cout << "Welcome! " << endl;
cout << " " << endl;
Sleep(1000);
cout << "...ADVENTURE-LOADING..." << endl;
Sleep(1000);
cout << " " << endl;
GamePanel gamePanel("maplevel1.txt");
gamePanel.playGame();
}
}
//IF CHOICE = 2 PLAY GAME
else if (choice == 2) {
cout << "Welcome! " << endl;
cout << " " << endl;
Sleep(1000);
cout << "...ADVENTURE-LOADING..." << endl;
Sleep(1000);
cout << " " << endl;
GamePanel gamePanel("maplevel1.txt");
gamePanel.playGame();
}
//EXIT
else if (choice == 3) {
cout << "The game will now exit successfully" << endl;
return 0;
}
//INVALID INPUT
else {
cout << "Invalid input!" << endl;
exit(1);
}
return 0;
}