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 Gamepad N5110
Diff: snake/snake.h
- Revision:
- 1:b49c36604125
- Parent:
- 0:b67614a0c4cf
- Child:
- 2:934daa65f73d
--- a/snake/snake.h Tue Apr 02 06:46:47 2019 +0000
+++ b/snake/snake.h Sat Apr 13 10:07:50 2019 +0000
@@ -1,3 +1,7 @@
+#ifndef SNAKE_H
+#define SNAKE_H
+
+
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
@@ -7,20 +11,22 @@
public:
snake();
- ~snake();
- void update();
- void init(int x,int y,int size,int speed);
- void draw(N5110 &lcd);
+ ~snake();
+ void init(int size,int length);
+ void update(int direction, int length);
+ void draw(N5110 &lcd, int length);
void add_score();
int get_score();
- Vector2D get_pos();
+ int get_length();
private:
Vector2D _velocity;
int _size;
- int _x;
- int _y;
+ int _x [40];
+ int _y [40];
int _score;
+ int _length;
-};
\ No newline at end of file
+};
+#endif
\ No newline at end of file