diff --git a/EscapeTheRoomMain.cbp b/EscapeTheRoomMain.cbp new file mode 100644 index 0000000..fe6efa4 --- /dev/null +++ b/EscapeTheRoomMain.cbp @@ -0,0 +1,40 @@ + + + + + + diff --git a/EscapeTheRoomMain.depend b/EscapeTheRoomMain.depend new file mode 100644 index 0000000..e6ace5a --- /dev/null +++ b/EscapeTheRoomMain.depend @@ -0,0 +1,10 @@ +# depslib dependency file v1.0 +1641316563 source:d:\ati\1st semester\sp\project\escapetheroommain\main.cpp + + + + + + + + diff --git a/EscapeTheRoomMain.layout b/EscapeTheRoomMain.layout new file mode 100644 index 0000000..2ec4161 --- /dev/null +++ b/EscapeTheRoomMain.layout @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/bin/Debug/EscapeTheRoom.exe b/bin/Debug/EscapeTheRoom.exe new file mode 100644 index 0000000..36db978 Binary files /dev/null and b/bin/Debug/EscapeTheRoom.exe differ diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..f8075d8 --- /dev/null +++ b/main.cpp @@ -0,0 +1,1119 @@ +#include +#include +#include +#include +#include +#include +#include + +void welcome(); +void mainmenu(); +void howtoplay(); +void playgame(); +void gameover(); +void gamewon(); +void credits(); +void quit(); +void room1(); +void room2(); +void room3(); +void room4(); +void quittext(); +void answeriscorrect(); +void answeriswrong(); +void roomselect(); +void questionselct(); +void timeconverter(); +void variablereset(); +void rankselect(); +char timedanswer(char); +void timeout(); +void timeleft(); +void savetohistory(); +void history(); +void namechange(); + +using namespace std; +int health=3; +int level =1; +int duration; +int c_start; +int c_end; +int hours = 0; +int minutes = 0; +int seconds = 0; +int timed; +int i=0; +int historyh=0; +int historyv=1; +char a; +string playername; +string roomname; +string rankname; +string gamehistory[25][3]={{"Name","Score","Status"}}; +bool gamerunned=false; +bool gamewin=false; +int main() +{ + welcome(); + cout<<"Enter Your Username (Do not use Space): "; + cin>>playername; + system("cls"); + welcome(); + mainmenu(); + return 0; +} + +void welcome() +{ + system("color B"); + cout << "+-----------------------------------------------------------------------------------------------------+" << endl; + cout << "| Welcome To |" << endl; + cout << "+-----------------------------------------------------------------------------------------------------+" << endl; + cout << "| ####### ####### ###### |" << endl; + cout << "| # #### #### ## ##### ###### # # # ###### # # #### #### # # |" << endl; + cout << "| # # # # # # # # # # # # # # # # # # # ## ## |" << endl; + cout << "| ##### #### # # # # # ##### # ###### ##### ###### # # # # # ## # |" << endl; + cout << "| # # # ###### ##### # # # # # # # # # # # # # |" << endl; + cout << "| # # # # # # # # # # # # # # # # # # # # # |" << endl; + cout << "| ####### #### #### # # # ###### # # # ###### # # #### #### # # |" << endl; + cout << "+-----------------------------------------------------------------------------------------------------+" << endl; +} +void mainmenu() +{ + variablereset(); + string playername; + int a; + cout << "| Main Menu |" << endl; + cout << "+-----------------------------------------------------------------------------------------------------+" << endl; + cout<>a; + + switch(a){ + case 1: + c_start=clock(); + playgame(); + break; + case 2: + howtoplay(); + break; + case 3: + credits(); + break; + case 4: + history(); + break; + case 5: + namechange(); + break; + case 6: + quit(); + break; + default: + cout<<"Invalid Input"<0) + { + while (level<=21){ + roomselect(); + questionselct(); + } + } + if (health==0){ + gameover(); + } +} +void namechange() +{ + system("cls"); + welcome(); + cout<<"Enter Your Username (Do not use Space): "; + cin>>playername; + system("cls"); + welcome(); + mainmenu(); +} +void quit() +{ + char q; + quittext(); + cout << "Are You Sure To Quit The Game? (y|n) :"; + cin >>q; + if(q=='Y'||q=='y'){ + quittext(); + cout << "| Thank You For The Playing With Us |" << endl; + cout << "+-----------------------------------------------------------------------------------------------------+" << endl; + system("pause"); + exit(0); + } + else if(q=='n'||q=='N'){ + system("cls"); + welcome(); + mainmenu(); + } + else{ + cout << "Invalid Input"<=0;Va1--) + { + cout<<"W W W W W W W W W W W W W W W W W"<=0; Va2--) + { + cout<<"W W W W W W W W W W W W W W W W W"<=0;Va1--) + { + cout<<"R R R R R R R R R R R R R R R R R"<=0; Va2--) + { + cout<<"R R R R R R R R R R R R R R R R R"<= i) + { + timeout(); + } + } + cin >> a; + return a; + _getch(); +} +void timeout() +{ + system("cls"); + system("color 4"); + cout << "+-----------------------------------------------------------------------------------------------------+" << endl; + cout << "| Oh No! Your are Ran Out "<