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 ll16j23s_test_docs
SnakeBody Class Reference
#include <SnakeBody.h>
Public Member Functions | |
| void | init () |
| Initialises the body. | |
| void | add_length (int increase) |
| Adjusts the _length_increase variable so the snake's length gradually increases. | |
| void | run (Gamepad &pad, N5110 &lcd, bool &_death) |
| Runs the appropriate functions for the body. | |
| void | reset () |
| Resets body variables so game can be replayed. | |
Detailed Description
- Functions that exclusively control the snake body
- Date:
- May 2020
- Version:
- V1.0
Definition at line 17 of file SnakeBody.h.
Member Function Documentation
| void add_length | ( | int | increase ) |
Adjusts the _length_increase variable so the snake's length gradually increases.
- Parameters:
-
The body units that the snake will eventually grow to
Definition at line 121 of file SnakeBody.cpp.
| void init | ( | ) |
Initialises the body.
Definition at line 19 of file SnakeBody.cpp.
| void reset | ( | ) |
Resets body variables so game can be replayed.
Definition at line 133 of file SnakeBody.cpp.
| void run | ( | Gamepad & | pad, |
| N5110 & | lcd, | ||
| bool & | _death | ||
| ) |
Runs the appropriate functions for the body.
- Parameters:
-
Gamepad LCD _death is the flag for if there is a collision (in this case snake-snake)
Definition at line 125 of file SnakeBody.cpp.
Generated on Fri Jul 15 2022 20:20:44 by
1.7.2