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
Snake Class Reference
#include <Snake.h>
Public Member Functions | |
| void | init (int _x, int _y, int score, int _speed, int snakeheight, int snakewidth) |
| The Initial setup of the of the snake | |
| void | draw (N5110 &lcd) |
| For drawing the snake on the screen allows the use of the LCD | |
| void | update (Direction d, float mag) |
| void | add_score () |
| Eating an apple will add to the score | |
| int | get_score () |
| Vector2D | get_pos () |
| Vector2D | get_move () |
| Vector2D | get_Direction () |
| void | set_move (Vector2D m) |
| Sets the Movement of the snake | |
Detailed Description
Snake Class File.
Class containing the snake for the actual game.
- Date:
- June 2020
Definition at line 14 of file Snake.h.
Member Function Documentation
| void draw | ( | N5110 & | lcd ) |
| Vector2D get_Direction | ( | ) |
- Returns:
- Gets the direction the snake travels in can be only North, East, South or West and the snake can't move in other directions.
| Vector2D get_move | ( | ) |
| Vector2D get_pos | ( | ) |
| void init | ( | int | _x, |
| int | _y, | ||
| int | score, | ||
| int | _speed, | ||
| int | snakeheight, | ||
| int | snakewidth | ||
| ) |
| void set_move | ( | Vector2D | m ) |
Sets the Movement of the snake
Generated on Sat Jul 16 2022 21:38:04 by
1.7.2