Snoke
game.h
Go to the documentation of this file.
1 
11 #ifndef GAME_H
12 #define GAME_H
13 #include "../Snake/snake.h"
14 #include "../Labyrinth/labyrinth.h"
15 #include "../Labyrinth/change.h"
16 #include <ncurses.h>
17 #include <iostream>
18 #include <string>
19 #include <time.h>
20 #include <signal.h>
21 
30 class Game
31 {
32  private:
33  int speed;
34  int loops;
38  void setSpeed(int sp);
39  void setLoops(int loops);
40  bool initSnake(Point begin, short dir, int length);
41  public:
42  bool init(int size = 20, int sp = 100, int loops = -1);
43  int run();
44 };
45 
46 #endif
void setSpeed(int sp)
The method to change the game speed without giving the direct access and some error handling...
Definition: game.cpp:183
class for containing and displaying the game field
Definition: labyrinth.h:66
bool init(int size=20, int sp=100, int loops=-1)
Initializes game.
Definition: game.cpp:38
int speed
Definition: game.h:33
Labyrinth labyrinth
Definition: game.h:37
int run()
Main game loop.
Definition: game.cpp:68
Snake * snakeEnemies
Definition: game.h:36
bool initSnake(Point begin, short dir, int length)
Snake initialization with labyrinth updating.
Definition: game.cpp:171
void setLoops(int loops)
sets loops with some error holding
Definition: game.cpp:57
Main game class.
Definition: game.h:30
Describes the Snake entity of the game.
Definition: snake.h:79
int loops
Definition: game.h:34
Snake snake
Definition: game.h:35
Coordinates and style of the cell in console window.
Definition: common.h:52