
Aceix::Code
By:
aceix on
Oct 18th, 2012 | syntax:
C++ | size: 1.88 KB | hits: 8 | expires: Never
#ifndef INTRO_H_INCLUDED
#define INTRO_H_INCLUDED
#define macroCheckForEnter if(GetAsyncKeyState(VK_RETURN)){iCheck=1; goto end;}
const void Gray() {SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 8); };
const void White(){SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);}
const void LWhite(){SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);};
const void Cyan() {SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 11);};
const void Red() {SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);};
const char* szStartStory[5]{"\n"
" ____ | | _____ \n",
"| | ___ ___ ___ | | ___ ___ ___ ____ | . \n",
"| | | | | |___| | | | | | | | | | | | __ __ ___ \n",
"| | | | | | | | |--- | | | | ____| | | | | | |___| \n",
" ---- | | |___ |___ ---- | --- | | |____| | | | | | |___ \n"};
string szStoryMain("There was a man..."); //To be continued...
const void fnPlayIntro()
{
string szLoading("Aceix");
int iCheck=0;
system("CLS");
cout<<"\n\nHit \"ENTER\" key to skip intro..."<<endl<<endl;
PlaySound(TEXT("test.wav"),
NULL,SND_FILENAME|SND_ASYNC);
Cyan();
for(int i=0;i<5;i++)
{
cout<<szStartStory[i];
macroCheckForEnter;
Sleep(500);
}
cin.get();
end:
LWhite();
cout<<"\n\n\n"<<setw(75)<<right<<"Loading..."<<endl<<setw(75);
for(string::iterator it=szLoading.begin();
it!=szLoading.end();
it++)
{
cout<<right<<*it;
Sleep(1000);
}
cout<<"\n\nHit enter to go to the main menu!";
cin.ignore();
if(iCheck==1) cin.get();
White();
PlaySound(NULL,NULL,SND_PURGE);
}
#endif // INTRO_H_INCLUDED