nsnake
Classic snake game for the terminal
main.cpp
1 #include <Engine/Flow/StateManager.hpp>
2 #include <Engine/Graphics/Ncurses.hpp>
3 #include <Engine/Helpers/Utils.hpp>
4 #include <Engine/EngineGlobals.hpp>
5 #include <Config/Globals.hpp>
6 #include <Config/Arguments.hpp>
7 #include <States/GameStateMainMenu.hpp>
8 
9 int main(int argc, char *argv[])
10 {
11  try
12  {
13  // Settings
14  EngineGlobals::init();
15  Globals::init();
17  Arguments::parse(argc, argv);
18 
19  // Misc Initializations
20  Utils::Random::seed();
21  Ncurses::init();
22  Colors::init();
23 
24  // Actually running the game
25  StateManager states;
26  states.run(new GameStateMainMenu());
27 
28  // Finishing things
30  Ncurses::exit();
32  }
33  catch (...)
34  {
35  // I dont really have a nice exception-handling scheme right
36  // now. I must learn how to properly deal with them.
37  Ncurses::exit();
38  return 666;
39  }
40  return 0;
41 }
42 
void saveFile()
Loads global variables to the default file.
Definition: Globals.cpp:262
void loadFile()
Loads global variables from the default file.
Definition: Globals.cpp:141
void init()
Initializes global variables with default values.
Definition: Globals.cpp:78
void warnErrors()
Warns the user about any errors and warnings found during the program's execution.
Definition: Globals.cpp:371