|
Snoke
|
Main game class. More...
#include <game.h>

Public Member Functions | |
| bool | init (int size=20, int sp=100, int loops=-1) |
| Initializes game. More... | |
| int | run () |
| Main game loop. More... | |
Private Member Functions | |
| void | setSpeed (int sp) |
| The method to change the game speed without giving the direct access and some error handling. More... | |
| void | setLoops (int loops) |
| sets loops with some error holding More... | |
| bool | initSnake (Point begin, short dir, int length) |
| Snake initialization with labyrinth updating. More... | |
Private Attributes | |
| int | speed |
| int | loops |
| Snake | snake |
| Snake * | snakeEnemies |
| Labyrinth | labyrinth |
Main game class.
| speed | - game refresh rate(in milliseconds) |
| snake | - the local player controlled snake |
| snakeEnemies | - the remotely controlled snake entities |
| labyrinth | - object containing labyrinth, displaying it, etc |
| bool Game::init | ( | int | size = 20, |
| int | speed = 100, |
||
| int | loops = -1 |
||
| ) |
Initializes game.
| size | - size of the game field(size - 2 columns, size/2 - 2 rows) |
| speed | - speed of the game(1 / refresh rate) in milliseconds |
| loops | - for how many loops the game should run |
Definition at line 38 of file game.cpp.


|
private |
Snake initialization with labyrinth updating.
| begin | - starting Point of a snake(where the tail segment will be situated) |
| dir | - direction of snake's 'growth' as well as it's starting direction |
| length | - the length of a 'new born' snake |
Definition at line 171 of file game.cpp.


| int Game::run | ( | ) |
|
private |
|
private |