Advertisement
Guest User

main.cpp

a guest
Nov 20th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.96 KB | None | 0 0
  1. #include "menu.h"
  2. #include "fire.h"
  3. #include "monster.h"
  4. #include "player.h"
  5. #include "invader.h"
  6.  
  7. int main()
  8. {
  9.     Invader game;
  10.  
  11.     game.SetupLevel();
  12.     while (game.playing)
  13.     {
  14.         game.InputWindow();
  15.         game.Logic();
  16.         game.DisplayWindow();
  17.         SLEEP_THREAD;
  18.     }
  19.  
  20.     echo();
  21.     nocbreak();
  22.     endwin();
  23.  
  24.     mciSendString("close intro1_sound", NULL, 0, NULL);
  25.     mciSendString("close intro2_sound", NULL, 0, NULL);
  26.     mciSendString("close shooting_sound", NULL, 0, NULL);
  27.     mciSendString("close b_death_sound", NULL, 0, NULL);
  28.  
  29.     if (Invader::setLevel != 6)
  30.     {
  31.         std::cout << "\t\t GAME OVER --- YOU LOST";
  32.         std::this_thread::sleep_for(std::chrono::seconds(2));
  33.     }
  34.     else
  35.     {
  36.         std::cout << "W.O.W! Congratulations!! You finally did it! Who would have thought after all these tries!\n\n";
  37.         std::this_thread::sleep_for(std::chrono::seconds(2));
  38.     }
  39.  
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement