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:
- 7:24a3f13ce36d
- Parent:
- 6:266fb8fc17f4
- Child:
- 8:59b01b57f0da
diff -r 266fb8fc17f4 -r 24a3f13ce36d SnakeEngine/SnakeEngine.h
--- a/SnakeEngine/SnakeEngine.h Thu May 28 22:56:46 2020 +0000
+++ b/SnakeEngine/SnakeEngine.h Sun May 31 14:12:45 2020 +0000
@@ -18,17 +18,24 @@
SnakeEngine();
~SnakeEngine();
- void init(int head_length,int head_speed);
+ void init(int head_length,int head_speed, int _food_size);
void read_input(Gamepad &pad);
+
void update(Gamepad &pad, N5110 &lcd);
void draw(N5110 &lcd);
+
private:
int hx;
- int hy;
+ int hy;
+ int fx;
+ int fy;
int _head_length;
int _head_speed;
+ int score;
int _nbody;
-
+ int _food_size;
+ void eat_food(Gamepad &pad);
+ void collison
Head _h;
Body _b;
Food _f;