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.
Diff: SnakevsBlock/SnakevsBlock.h
- Revision:
- 9:d1d79d4ee673
- Parent:
- 7:48ba87cd79b5
- Child:
- 10:751bd953fa27
diff -r 890b986b16a4 -r d1d79d4ee673 SnakevsBlock/SnakevsBlock.h
--- a/SnakevsBlock/SnakevsBlock.h Tue Mar 26 18:36:50 2019 +0000
+++ b/SnakevsBlock/SnakevsBlock.h Wed Mar 27 18:20:36 2019 +0000
@@ -5,6 +5,7 @@
#include "N5110.h"
#include "Gamepad.h"
#include "Snake.h"
+#include "SnakeFood.h"
class SnakevsBlock
{
@@ -46,14 +47,24 @@
int snakex;
int snakey;
int length;
+ int foodbuff; //this makes food 1,2,and 3 come at seperate times
private:
Snake _s;
+ SnakeFood _f;
+ SnakeFood _ff;
+ SnakeFood _fff;
int _speed;
Direction _d;
float _mag;
int n;
+ /** Check for Snake and Food collision
+ *
+ * This function checks if the Snake has come into contact with it's food.
+ */
+ void CheckSnakeFoodCollision(Gamepad &pad);
+
};
#endif
\ No newline at end of file