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: SnakeEngine/SnakeEngine.h
- Revision:
- 3:beb0cc405b1e
- Child:
- 4:748b3e0062f6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SnakeEngine/SnakeEngine.h Wed May 27 16:14:56 2020 +0000
@@ -0,0 +1,33 @@
+#ifndef SNAKEENGINE_H
+#define SNAKEENGINE_H
+
+#include "mbed.h"
+#include "N5110.h"
+#include "Gamepad.h"
+#include "Head.h"
+
+// gap from edge of screen
+#define GAP 2
+
+class SnakeEngine
+{
+
+public:
+ SnakeEngine();
+ ~SnakeEngine();
+
+ void init(int head_length,int head_speed);
+ void read_input(Gamepad &pad);
+ void update(Gamepad &pad);
+ void draw(N5110 &lcd);
+ private:
+
+ int _head_length;
+ int _head_speed;
+
+ Head _h;
+ Direction _d;
+
+};
+
+#endif
\ No newline at end of file