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:
- 5:256e5e0b6cd7
- Parent:
- 4:c5addc5475d3
- Child:
- 12:cb3a81adf48b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SnakeHead/SnakeHead.h Thu May 14 12:06:26 2020 +0000
@@ -0,0 +1,34 @@
+#ifndef SNAKEHEAD_H
+#define SNAKEHEAD_H
+
+#include "mbed.h"
+#include "N5110.h"
+#include "Gamepad.h"
+#include "time.h"
+
+class SnakeHead
+{
+
+public:
+ SnakeHead();
+ ~SnakeHead();
+ void init(int size, int speed);
+ void draw(N5110 &lcd);
+ void update();
+ void change_direction(Direction d);
+ void set_velocity(Vector2D v);
+ Vector2D get_velocity();
+ Vector2D get_pos();
+ void set_pos(Vector2D p);
+
+
+private:
+ Vector2D _velocity;
+ Gamepad pad;
+ int _size;
+ int _speed;
+ int _x;
+ int _y;
+};
+
+#endif
\ No newline at end of file