Snake.
More...
#include <game.h>
|
void | processGameLogic () |
| Processes the logic of the game.
|
|
|
void | keyPressEvent (QKeyEvent *event) override |
| Stores the valid key events in a queue. More...
|
|
void | processNextKeyEvent () |
| Processes the key events in the queue. More...
|
|
void | checkCollision (Snake &snake, Snake &adv_snake, const bool &is_adv) |
| Checks if a snake will collide with another entity.
|
|
void | updateGameScore () |
| Increases/Decreases the player's score by one.
|
|
|
std::queue< unsigned short > | key_events |
| Stores the key events.
|
|
const unsigned int | MAX_SNAKE_LENGTH = 64 |
| The maximum length of the snake.
|
|
Snake | snake |
| The snake.
|
|
Food | food |
| Instance of the egg/rat which will be eat by the snake.
|
|
Snake.
A reproduction of the timeless classic game
◆ GameMode
Enumerates the available game modes.
Enumerator |
---|
Classic | Classic snake game.
|
Hunt | Game variant in which the food moves too.
|
Battle | Game variant in which you play against another snake.
|
◆ keyPressEvent()
void SnakeGame::keyPressEvent |
( |
QKeyEvent * |
event | ) |
|
|
overrideprivate |
◆ processNextKeyEvent()
void SnakeGame::processNextKeyEvent |
( |
| ) |
|
|
private |
The documentation for this class was generated from the following files:
- logdoctor/games/snake/game.h
- logdoctor/games/snake/game.cpp