Академический Документы
Профессиональный Документы
Культура Документы
#include <cstdlib>
#include <windows.h>
#include <conio.h>
#include <ctime>
#include <fstream>
#include <iomanip>
using namespace std;
int a=0,b;
char sl; //selection variable
while(1) //loop for repeating actions after each start
{
if(a==0) goto play;
if(a>0) //if you play not the first time, it will ask you
if you want to play
{
score=0;
cout<<"Do you want to play again? [y/n] ";
cin>>sl;
if(sl=='n') goto quit;
else goto play;
}
play:
menu(); //calling menu function
cin>>sl;
switch(sl) //menu selections
{
case '1':
{
game(); //if you choose play, it calls function game
break;
}
case '2': //other selections-other functions
{
help();
goto play;
break;
}
case '3':
{
credits();
goto play;
break;
}
case '4':
{
goto quit; //exits game
break;
}
default:
{
goto play;
break;
}
}
a++; //variable for checking how many times you've played
}
quit:
{
cout<<"I quit."; //stops game, app closes.
}
return 0;
}
void credits()
{
char sel;
system("cls");
while(true)
{
cout<<""<<endl<<endl;
cout<<" Lead programmer: hakeris1010 "<<endl<<endl;
cout<<" Designer: hakeris1010 "<<endl<<endl;
cout<<" Testers: hakeris1010 "<<endl<<endl;
cout<<" Special thanks to: hakeris1010 ,Dong Nguyen
(original)"<<endl<<endl;
cout<<" Version: 1.0 "<<endl<<endl<<endl;
cout<<"Go back? [y/n] ";
cin>>sel;
if(sel=='y') return;
else system("cls");
}
}
void help()
{
char sel;
system("cls");
while(true)
{
cout<<""<<endl<<endl;
cout<<" Controls: Press any key to fly up.
"<<endl<<endl;
cout<<" Goal: Fly through the holes between the pipes.
"<<endl;
cout<<" When you pass through the hole,you get 1 point.
"<<endl;
cout<<" Try to pass as much as you can.
"<<endl;
cout<<" But be careful, don't hit the pipes or the
ground!"<<endl<<endl;
cout<<" Are you ready? Go!
"<<endl<<endl<<endl;
cout<<"Go back? [y/n] ";
cin>>sel;
if(sel=='y') return;
else system("cls");
}
}
//version 1.0
//made by hakeris1010
//thanks for playing!!!