15 KiB
15 KiB
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
</head>
The documentation for this class was generated from the following files:
Generated by 1.9.8 </html>
LogDoctor 3.00
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
|
Loading...
Searching...
No Matches
SnakeGame Class Reference
#include <game.h>
Inheritance diagram for SnakeGame:
Private Types | |
enum class | GameMode { Classic , Hunt , Battle } |
Enumerates the available game modes. More... | |
Private Slots | |
void | processGameLogic () |
Processes the logic of the game. | |
Private Member Functions | |
void | keyPressEvent (QKeyEvent *event) override |
Stores the valid key events in a queue. | |
void | processNextKeyEvent () |
Processes the key events in the queue. | |
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. | |
Private Attributes | |
std::queue< unsigned short > | key_events |
Stores the key events. | |
const size_t | 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. | |
Detailed Description
A reproduction of the timeless classic game
Member Enumeration Documentation
◆ GameMode
|
strongprivate |
Member Function Documentation
◆ keyPressEvent()
|
overrideprivate |
Stores the valid key events in a queue.
Valid keys are UP/DOWN/LEFT/RIGHT arrows and W/S/A/D letters
- See also
- key_events, processNextKeyEvent()
◆ processNextKeyEvent()
|
private |
Processes the key events in the queue.
- See also
- key_events, keyPressEvent()
The documentation for this class was generated from the following files:
- logdoctor/games/snake/game.h
- logdoctor/games/snake/game.cpp
Generated by 1.9.8 </html>