Skip to content
Permalink
main
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 <string>
#include<windows.h> //used to maximize command screen
#include<cstdlib> //defines a collection of functions
using namespace std;
//functions included
void start();
void Game();
void gameStart();
void Intro();
void Choice1();
void Choice2();
void Choice3();
void Choice4();
void Choice5();
void Area51();
void youWin();
void Credits();
void Jail();
void youDead();
void gameOver();
int userInput =0;
int playerLocation = 0;
string name;
int main(){
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_MAXIMIZE);
start();
system("exit");
}
void start(){
// this is the intro
system ("cls");
system("color c");
cout<<"#########################################################\n";
cout<<"############## ALIEN ESCAPE ##################\n";
cout<<"#########################################################\n";
Beep(80,200);//this will make a beep sounds
Beep(100,250);
Beep(120,300);
cout<<"#########################################################\n";
cout<<"#########################################################\n";
system("cls");
cout<<"#########################################################\n";
cout<<"############## YOU WILL BE ABLE TO ESCAPE ###############\n";
cout<<"#########################################################\n";
Beep(80,200);
Beep(100,250);
Beep(120,300);
cout<<"#########################################################\n";
cout<<"#########################################################\n";
system("pause");
system("cls");
Game(); //goes to the game function
}
void Game(){
system("color a");
cout<<"#########################################################\n";
cout<<"#########################################################\n";
cout<<"##############[1] new game ##################\n";
cout<<"##############[2] credits ##################\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
Beep(200,250);
Beep(220,300);
cout<<"\n\n>\t";
while ( !(cin>>userInput) || userInput< 1 || userInput > 3){
cout<<"invalid input. must be [1] or [2].\n ";
cin.clear();
cin.ignore(100,'\n');
}
if (userInput == 1){
//create a new game
system("cls");
gameStart();
} else {
system("cls");
Credits(); // finish the game
}
}
void gameStart(){
cout<<"#########################################################\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
cout<<"############ READY TO START ##################\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
Beep(220,250);
Beep(250,300);
Beep(300,350);
Beep(200,250);
Beep(220,300);
system("pause");
system("cls");
Intro();
}
void Intro(){
//user name
system("color 2");
cout<< " what is your name?\n";
string name;
cout << "\n\t";
cin>> name;
cout<<"Ready to start your adventure, "<< name << " remember you have less choices, which one will make you survive.\n";
system("pause");
system("cls");
Choice1();
}
void Choice1(){
cout<< " Wake up, you have to wake up right now. Finally! ";
cout<< " Listen! I'm the system built into your helmet."<< name <<"\n I will guide you step by step.\n but we have to get back to our ship right away";
cout<<" I don't know if you remember what happened, but our ship crashed on an unknown planet.\n";
cout<<" We had a collision with an asteroid and as we crashed the security system released our escape pod.\n";
cout<<"***********************************************************\n";
cout<<"[1] We can go to the road.\n";
cout<<"[2] We can go trough the forest. \n";
cout<<"[3] We can go back to our ship straight away.\n";
cout<<"***********************************************************\n";
cout<<"\n\t";
int playerLocation= 0 ;
while(!(cin >> playerLocation) || playerLocation < 1 || playerLocation > 3)
{
cout<<" Invalid variable. must be in range of asked choice.\n";
cin.clear();
cin.ignore(100,'\n');
}
if (playerLocation == 1){
//to the road
system("cls");
cout<<" We walk down the road, it seems very long but you must not be discouraged,\n we must be able to find a way back to the mother ship.\n ";
cout<<" My systems reveal that something is approaching.\n";
cout<<"***********************************************************\n";
cout<<"[1] You hide behind a large stone. \n";
cout<<"[2] Do you want to check what it is? \n";
cout<<"***********************************************************\n";
cout<<"\n\t";
while (!(cin>> userInput) || userInput < 1 || userInput > 3 ){
cout<<"invalid choice.\n ";
cin.clear();
cin.ignore(100,'\n');
}
userInput;
if (userInput == 1){
cout<<" While you are hiding a vehicle passes by you, you see a strange creature driving.\n";
cout<< " You go back on your way, going in the same direction as the vehicle.\n";
system("pause");
system("cls");
Choice2();
}else if (userInput == 2){
cout<<" A strange noise, an engine. The vehicle suddenly appears with a strange creature inside.\n";
cout<<" The car stops and the human looks at you terrified.\n";
cout<<" Suddenly you hear screams and the car's engine starting.\n";
cout<<" Like lightning the car hits you, destroying me all at once.\n";
cout<<"#########################################################\n";
cout<<"################ THE END #################\n";
cout<<"#########################################################\n";
system("pause");
system("cls");
youDead();
}else{
cout<<" Invaild input.\n";
}
}else if (playerLocation == 2){
//to the forest
cout<<" According to my information this is commonly called forest, there are many trees,\n they are the primary source of oxygen on this planet.";
cout<<" But you have to be very careful, there are docile but also dangerous creatures.\n";
cout<<" If we can get back to the mothership with the information we take, we can conquer this planet called earth.\n";
cout<<" As you try to get out of the woods, a threatening animal appears in front of you.\n";
cout<<"***********************************************************\n";
cout<<"[1] You start running. \n";
cout<<"[2] You use your invisibility. \n";
cout<<"***********************************************************\n";
cout<<"\n\t";
while (!(cin>> userInput) || userInput < 1 || userInput > 3 ){
cout<<"invalid choice.\n ";
cin.clear();
cin.ignore(100,'\n');
}
userInput;
if (userInput == 1){
cout<<" You run fast while the bear chases you, you can't sow it.\n";
cout<<" You keep hearing his grunts as you run to save your life.\n";
system("pause");
system("cls");
Choice3();
}else if ( userInput == 2){
cout<<" You are invisible as the animal slowly approaches your figure.\n";
cout<<" The animal continues to smell the air getting closer and closer.\n";
cout<<" It is as if the bear knew of your presence.\n";
cout<<" In spite of everything, you remain firm in your position waiting for the creature to vanish.\n";
cout<<" Suddenly the creature attacks you, biting your face.\n Without knowing it, we were in its territory and you paid the consequences.\n";
cout<<"#########################################################\n";
cout<<"################ THE END #################\n";
cout<<"#########################################################\n";
system("pause");
system("cls");
youDead();
}else{
cout<<"invalid input.\n";
}
}else if ( playerLocation == 3){
// to the spacecraft
cout<<" We must find a way back to the ship before these beings notice us.\n";
system("pause");
system("cls");
Choice4();
} else{
cout<<" Inavlid input";
}
}
void Choice2(){
cout<<" We have arrived in a city, where there are many human beings.\n";
cout<<" My systems reveal a lot of technological equipment,\n"<<name<<" if you get close to one of their devices maybe I can track our spacecraft.\n";
cout<<" You can go near one of these buildings, if you are close enough I can start the tracking system.\n";
cout<<"***********************************************************\n";
cout<<"[1] You approach the building directly. \n";
cout<<"[2] You use your invisibility system. \n";
cout<<"***********************************************************\n";
cout<<"\n\t";
while (!(cin>> userInput) || userInput < 1 || userInput > 3 ){
cout<<"invalid choice.\n ";
cin.clear();
cin.ignore(100,'\n');
}
userInput;
if (userInput == 1){
cout<<" You approach the building regardless of what might happen.\n";
cout<<" My system starts looking for our spacecraft.\n";
cout<<" After a couple of minutes, a woman screams at the top of her voice. The city is on the alert.\n";
cout<<" Armed men approach us firing, until a shot catches you. \n";
system("pause");
system("cls");
youDead();
}else if (userInput == 2){
cout<<" You approach the building as my systems begin searching for our shipmnet..\n";
cout<<" After a couple of minutes, a woman walks by, briefcase in hand.\n";
cout<<" The woman turns the corner of the building and disappears.\n";
cout<<" I tracked our ship, it's not in the same location, it must have been picked up and transported.\n";
cout<<" The ship is about 5 km from our position.";
cout<<" Let's move.\n";
system("pause");
system("cls");
} else {
cout<<" Inavlid input";
}
}
void Choice3(){
cout<<" You run so fast that you come to a slope of a waterfall.\n";
cout<<" You look back to check the distance between you and that animal. \n";
cout<<" The bear has almost reached you.\n You are afraid to jump but you don't have much chance of surviving that animal.\n";
cout<<"***********************************************************\n";
cout<<"[1] You want to jump. \n";
cout<<"[2] you want to stay in your position. \n";
cout<<"***********************************************************\n";
cout<<" \n\t";
while (!(cin>> userInput) || userInput < 1 || userInput > 3 ){
cout<<"invalid choice.\n ";
cin.clear();
cin.ignore(100,'\n');
}
userInput;
if (userInput == 1){
cout<<" You fall into the water but as you come out you catch a glimpse of the bear staring at you and then disappearing.\n";
cout<<" You know you don't have many options, the best thing you can do is go back and find your spaceship.\n ";
cout<<" The sooner we get away from this planet the better it will be.\n";
cout<<" That bear is still on your trail, it's probably best to move.\n";
system("pause");
system("cls");
Choice4();
} else if (userInput == 2){
cout<<" The bear tries to bite you but you both fall off the slope.\n";
cout<<" During the fall he manages to tear off a limb.\n";
cout<<" Now you are dying. You can still be conscious as the animal pulls you out of the water.\n";
cout<<" In your last moments, see your death in the face as it feeds on you.\n";
cout<<"#########################################################\n";
cout<<"################ HORRIBLE DEATH #################\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
cout<<"################ THE END #################\n";
cout<<"#########################################################\n";
system("pause");
system("cls");
youDead();
} else {
cout<<" Inavlid input";
}
}
void Choice4(){
cout<<" We must proceed to the last known position of the spaceship.\n";
cout<<" My systems lost their signal shortly after the crash.\n";
cout<<" We have arrived. Be careful there are human beings dressed in black and with sunglasses.\n";
cout<<"***********************************************************\n";
cout<<"[1] You want to attack them. \n";
cout<<"[2] you want to make yourself invisible to them and find out where they are going. \n";
cout<<"***********************************************************\n";
cout<<"\n\t";
while (!(cin>> userInput) || userInput < 1 || userInput > 3 ){
cout<<"invalid choice.\n ";
cin.clear();
cin.ignore(100,'\n');
}
userInput;
if (userInput == 1){
cout<<" How you want to attack them, without a strategy it would be very dangerous.\n";
system("pause");
system("cls");
Choice5();
}else if( userInput == 2){
cout<<" You make yourself invisible and hide inside one of their trucks.\n";
cout<<" After half an hour of traveling, they arrived at their base.\n";
cout<<" Finally ! my system is connecting to the ship, even though the signal is weak we are very close.\n";
cout<<" I hope you are ready,"<< name <<" we have almost reached our destination.\n";
system("pause");
system("cls");
Area51();
}else {
cout<<" Inavlid input";
}
}
void Choice5(){
cout<<" You approach slowly checking the agents.\n";
cout<<" There are six agents, they are armed. You have to pay attention.\n";
cout<<" Their weapons fire an amount of electricity that could knock you unconscious.\n";
cout<<"***********************************************************\n";
cout<<"[1] You want to attack directly. \n";
cout<<"[2] you want to make yourself invisible to them and kill them one by one. \n";
cout<<"***********************************************************\n";
cout<<"\n\t";
while (!(cin>> userInput) || userInput < 1 || userInput > 3 ){
cout<<"invalid choice.\n ";
cin.clear();
cin.ignore(100,'\n');
}
userInput;
if (userInput == 1){
cout<<" You attack them directly, you use your speed against them.\n";
cout<<" It seems they can't keep up with you, you can kill two of them.\n";
cout<<" One of them uses a partner to defend himself, you hit the partner but he manages to hit you.\n";
cout<<" Your movements are affected, but you can handle the pain.\n";
cout<<" Until others start hitting you and knocking you unconscious.\n";
system("pause");
system("cls");
Jail();
} else if (userInput == 2){
cout<<" You become invisible and you begin to approach them.\n";
cout<<" You manage to knock three of them offside.\n";
cout<<" When others realize the crime, it is too late for them.\n";
cout<<" They seem to know they have no hope against you. One of them tries to escape.\n";
cout<<" It's late for them, they're all dead.\n";
cout<<" With my system I can trace the place where they moved our spacecraft using their computer network.\n";
system("pause");
system("cls");
Area51();
}else {
cout<<" Invalid input.\n";
}
}
void Area51(){
cout<<" We have finally arrived at our destination.\n";
cout<<" There are a lot of agents so you need to be quick.\n";
cout<<" The spacecraft is located on the top floor of this gigantic building.\n";
cout<<" How are you going to achieve it.\n";
cout<<"***********************************************************\n";
cout<<"[1] Harnessing yourself by killing the humans until you get to the spaceship. \n";
cout<<"[2] You want to become invisible and reach the ship. \n";
cout<<"[3] Climbing into the building without getting noticed.\n";
cout<<"***********************************************************\n";
cout<<"\n\t";
while (!(cin>> userInput) || userInput < 1 || userInput > 4 ){
cout<<"invalid choice.\n ";
cin.clear();
cin.ignore(100,'\n');
}
userInput;
if (userInput == 1){
cout<<" You manage to fight and kill many agents.\n";
cout<<" But despite your strength you can't get inside the building.\n";
cout<<" Agents use all sorts of weapons to stop you.\n";
cout<<" And in the end they manage to kill you, leaving yours in front of the porch of the building.\n";
system("pause");
system("cls");
youDead();
} else if (userInput == 2 ){
cout<<" You make yourself invisible and and you pass all the guards at the main entrance.\n";
cout<<" You enter the building and see a long spiral staircase.\n";
cout<<" Start climbing the stairs paying attention to the guards passing around you.\n";
cout<<" There is only one room that separates you from the ship.\n";
cout<<" You step inside and a sound like a beep is heard.\n";
cout<<" A strange red light flashes and bars trap you inside the room.\n";
cout<<" ....";
system("pause");
system("cls");
Jail();
} else if ( userInput == 3 ){
cout<<" You climb into the building unnoticed.\n";
cout<<" You arrive at the top floor. See your ship from the window.\n";
cout<<" You break the window and you catapult yourself into the ship.\n";
cout<<" Turn on the ship and destroy the ceiling by flying off the ground.\n";
cout<<"#########################################################\n";
cout<<"################ THE END #################\n";
cout<<"#########################################################\n";
system("pause");
system("cls");
youWin();
}else{
cout<<" Invalid Input.\n";
}
}
void youWin(){
system("color A");
cout<<"#########################################################\n";
cout<<"############## YOU ARE BACK TO ###################\n";
cout<<"#########################################################\n";
cout<<"############ THE MOTHER SHIP ##################\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
Beep(10,50);
Beep(15,30);
Beep(50,30);
Beep(200,250);
system("pause");
system("cls");
gameOver();
}
void Credits(){
system("color a");
cout<<"#########################################################\n";
cout<<"############## CREATED BY ###################\n";
cout<<"#########################################################\n";
cout<<"############ SALAR KAZIM ##################\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
Beep(10,50);
Beep(15,30);
system("pause");
system("cls");
gameOver();
}
void youDead(){
system ( "color c");
cout<<"#########################################################\n";
cout<<"#########################################################\n";
cout<<"################# YOU ARE ######################\n";
cout<<"#########################################################\n";
cout<<"################### DEAD #############################\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
Beep(220,250);
Beep(250,300);
Beep(300,350);
Beep(200,250);
system("pause");
system("cls");
gameOver();
}
void Jail(){
cout<<"#########################################################\n";
cout<<"#########################################################\n";
cout<<"############ YOU HAVE BEEN CAPTURED #############\n";
cout<<"#########################################################\n";
cout<<"########### NOW THEY WILL EXPERIMENT ON YOU #############\n";
cout<<"#########################################################\n";
cout<<"########### SYSTEM SELF-DESTRUCTION #############\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
Beep(220,250);
Beep(250,300);
Beep(300,350);
Beep(200,250);
system("pause");
system("cls");
gameOver();
}
void gameOver(){
system("color c");
cout<<"#########################################################\n";
cout<<"#########################################################\n";
cout<<"############### GAME OVER #################\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
cout<<"#########################################################\n";
Beep(220,450);
Beep(250,500);
Beep(500,550);
}