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:
- 9:f3259d652208
- Parent:
- 8:59b01b57f0da
diff -r 59b01b57f0da -r f3259d652208 SnakeEngine/SnakeEngine.h
--- a/SnakeEngine/SnakeEngine.h Sun May 31 16:06:31 2020 +0000
+++ b/SnakeEngine/SnakeEngine.h Thu Jun 04 18:47:58 2020 +0000
@@ -18,11 +18,12 @@
SnakeEngine();
~SnakeEngine();
- void init(int head_length,int head_speed, int _food_size);
+ void init(int head_length,int head_speed, int _food_size, int score);
void read_input(Gamepad &pad);
void update(Gamepad &pad, N5110 &lcd);
void draw(N5110 &lcd);
+ void gameover(N5110 &lcd, Gamepad &pad);
private:
int hx;
@@ -31,12 +32,12 @@
int fy;
int _head_length;
int _head_speed;
- int score;
+ int _score;
int _nbody;
int _food_size;
bool _gameover;
void collison(Gamepad &pad, N5110 &lcd);
- void eat_food(Gamepad &pad);
+ void eat_food(Gamepad &pad, N5110 &lcd);
Head _h;
Body _b;