daily pastebin goal
44%
SHARE
TWEET

Aceix::Code

aceix Oct 18th, 2012 10 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef INTRO_H_INCLUDED
  2. #define INTRO_H_INCLUDED
  3.  
  4. #define macroCheckForEnter if(GetAsyncKeyState(VK_RETURN)){iCheck=1; goto end;}
  5.  
  6. const void Gray() {SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 8); };
  7. const void White(){SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);}
  8. const void LWhite(){SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);};
  9. const void Cyan() {SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 11);};
  10. const void Red()  {SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);};
  11.  
  12. const char* szStartStory[5]{"\n"
  13. " ____                    |    |                            _____                \n",
  14. "|    |  ___   ___  ___   |    |  ___   ___   ___    ____     |  .               \n",
  15. "|    | |   | |    |___|  |    | |   | |   | |   |  |    |    |     __ __   ___  \n",
  16. "|    | |   | |    |      |    | |---  |   | |   |   ____|    |  | |  |  | |___| \n",
  17. " ----  |   | |___ |___    ----  |      ---  |   |  |____|    |  | |  |  | |___  \n"};
  18.  
  19. string szStoryMain("There was a man...");  //To be continued...
  20.  
  21. const void fnPlayIntro()
  22. {
  23.     string szLoading("Aceix");
  24.     int iCheck=0;
  25.  
  26.     system("CLS");
  27.     cout<<"\n\nHit \"ENTER\" key to skip intro..."<<endl<<endl;
  28.     PlaySound(TEXT("test.wav"),
  29.                           NULL,SND_FILENAME|SND_ASYNC);
  30.     Cyan();
  31.     for(int i=0;i<5;i++)
  32.     {
  33.         cout<<szStartStory[i];
  34.         macroCheckForEnter;
  35.         Sleep(500);
  36.     }
  37.     cin.get();
  38.  
  39.     end:
  40.         LWhite();
  41.         cout<<"\n\n\n"<<setw(75)<<right<<"Loading..."<<endl<<setw(75);
  42.         for(string::iterator it=szLoading.begin();
  43.             it!=szLoading.end();
  44.             it++)
  45.         {
  46.             cout<<right<<*it;
  47.             Sleep(1000);
  48.         }
  49.         cout<<"\n\nHit enter to go to the main menu!";
  50.         cin.ignore();
  51.         if(iCheck==1) cin.get();
  52.         White();
  53.         PlaySound(NULL,NULL,SND_PURGE);
  54. }
  55.  
  56. #endif // INTRO_H_INCLUDED
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top