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: mbed
Game Class Reference
#include <Game.h>
Public Member Functions | |
| Game () | |
| Constructor. | |
| ~Game () | |
| Destructor. | |
| void | init (int x, int y) |
| init function | |
| void | update (Direction d) |
| Updates coordinate of snake. | |
| int | getLength () |
| Gets snake length. | |
| void | grow () |
| add snake length by 1 | |
| int | xcoordinate (int now) |
| Gets x coordinate of the snake. | |
| int | ycoordinate (int now) |
| Gets y coordinate of the snake. | |
Data Fields | |
| char | Previous_direction |
| the previous direction of snake | |
| int | _x [4032] |
| the _y and _y array | |
Detailed Description
The Game class.
the functions of game roles
- Date:
- May 2019
Definition at line 12 of file Game.h.
Constructor & Destructor Documentation
Member Function Documentation
| int getLength | ( | ) |
| void init | ( | int | x, |
| int | y | ||
| ) |
| void update | ( | Direction | d ) |
| int xcoordinate | ( | int | now ) |
| int ycoordinate | ( | int | now ) |
Field Documentation
| char Previous_direction |
Generated on Fri Jul 15 2022 14:43:24 by
1.7.2