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: Snake/Snake.h
- Revision:
- 0:d557f30e3a95
- Child:
- 1:6bcf09972c0d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Snake/Snake.h Mon Apr 30 14:10:48 2018 +0000
@@ -0,0 +1,54 @@
+#ifndef SNAKE_H
+#define SNAKE_H
+
+
+#include "mbed.h"
+#include "N5110.h"
+#include "Gamepad.h"
+#include "Fruit.h"
+
+
+
+class snake
+{
+ public:
+ snake();
+ ~snake();
+ void init();
+ void update(Direction d,float mag);
+ void draw(N5110 &lcd);
+ void point();
+ int get_point();
+ Vector2D get_pos();
+ void hitwall();
+ void eattail();
+ int eat_tail;
+
+
+
+ private:
+ int _point;
+ int dir;
+ int _array;
+ int _xoldpos[500];
+ int _yoldpos[500];
+ int _xnewpos[500];
+ int _ynewpos[500];
+
+
+
+
+};
+
+#endif
+
+
+
+
+
+
+
+
+
+
+