Snoke
Main.cpp
Go to the documentation of this file.
1 #include <ncurses.h>
2 #include "Screens/mainMenu.h"
3 #include "Game/game.h"
4 #include "iostream"
5 
6 int main()
7 {
8  /*
9  * Block initializing ncurses console in the current console window,
10  * and setting some parameters
11  */
12  initscr();
13  start_color();
14  noecho();
15  nodelay(stdscr, true);
16  curs_set(0);
17  keypad(stdscr, true);
18 
19  Game g;
20  g.init(70, 150, -1);
21  int gameReturn = g.run();
22 
23  refresh();
24  endwin();
25  switch(gameReturn)
26  {
27  case 1:
28  {
29  std::cout << "Incorrect Snake initialization, failed at function Game::initSnake" << std::endl;
30  return 1;
31  }
32  default:
33  return 0;
34  }
35 }
bool init(int size=20, int sp=100, int loops=-1)
Initializes game.
Definition: game.cpp:38
Definitions and prototypes for Game class.
int run()
Main game loop.
Definition: game.cpp:68
Main game class.
Definition: game.h:30
int main()
Definition: Main.cpp:6