Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: N5110 PinDetect PowerControl mbed
main.h File Reference
Header file for Snake, containing functions prototypes and global variables. More...
Go to the source code of this file.
Enumerations | |
| enum | DirectionName |
Enumerated type used for directions read from joystick. More... | |
| enum | GameMenu |
Enumerated type used to display different game menu screens. More... | |
Functions | |
| void | moveSnake () |
| Implements the actual game's functionality by moving the snake and checking when certain rules have been broken. | |
| void | speedSelect () |
| Moves the selection circle in the SELECTSPEED game menu either up or down depending on the direction in which the joystick is moved. | |
Variables | |
| DirectionName | currentDirection |
| DirectionName | previousDirection |
| GameMenu | currentGameMenu |
| int | printFlag |
| Various flags used in the game for notification of specific events. | |
| int | Aflag |
| int | Bflag |
| int | collisionFlag |
| int | borderFlag |
| int | score |
| Global variables. | |
| int | xCentre |
| int | yCentre |
| bool | gameOver |
| float | speed |
| std::vector< coordinate > | Snake |
| Vector that contains coordinate structs, represents the snake in game. | |
Detailed Description
Header file for Snake, containing functions prototypes and global variables.
Revision 1.0.
- Date:
- May 2015
Definition in file main.h.
Enumeration Type Documentation
| enum DirectionName |
| enum GameMenu |
Function Documentation
| void moveSnake | ( | ) |
| void speedSelect | ( | ) |
Variable Documentation
| int borderFlag |
| int collisionFlag |
collisionflag set in moveSnake() when snake collides with self
| bool gameOver |
| int printFlag |
| int score |
| std::vector<coordinate> Snake |
| int xCentre |
Generated on Tue Jul 12 2022 22:52:47 by
1.7.2