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
Diff: SnakeHead/SnakeHead.h
- Revision:
- 13:4fa0d5148216
- Parent:
- 12:cb3a81adf48b
diff -r cb3a81adf48b -r 4fa0d5148216 SnakeHead/SnakeHead.h
--- a/SnakeHead/SnakeHead.h Sun May 24 14:19:21 2020 +0000
+++ b/SnakeHead/SnakeHead.h Sun May 24 15:08:31 2020 +0000
@@ -21,7 +21,7 @@
/** Destructor */
~SnakeHead();
/** Initialise snake head position, speed an direction
- *@param Snake Head size
+ *@param Snake Head size
*@param Snake Head speed
*/
void init(int size, int speed);
@@ -30,12 +30,24 @@
/** Updates head position */
void update();
/** Changes the direction in whihc the head moves
- @param Direction d (N,E,S,W)
+ @param Direction of the joystick (N,E,S,W)
*/
void change_direction(Direction d);
+ /** Sets the velocity of the head
+ @param 2D vector for x and y speeds
+ */
void set_velocity(Vector2D v);
+ /** gets the current head velocity
+ @returns velocity
+ */
Vector2D get_velocity();
+ /** Gets the current position of the head
+ @returns position
+ */
Vector2D get_pos();
+ /** Sets the position of the head
+ @param 2D vector of x and y coordinates
+ */
void set_pos(Vector2D p);