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:
- 9:18b059e5abb9
- Parent:
- 2:934daa65f73d
- Child:
- 11:543c62bed764
diff -r b6ddc8e10da6 -r 18b059e5abb9 snake/snake.h
--- a/snake/snake.h Tue Apr 16 09:24:49 2019 +0000
+++ b/snake/snake.h Sat Apr 20 08:15:10 2019 +0000
@@ -1,27 +1,26 @@
#ifndef SNAKE_H
#define SNAKE_H
-
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
class snake
{
-
+
public:
snake();
- ~snake();
- void init(int size,int length);
+ ~snake();
+ int get_score();
+ int get_length();
+ int over;
+ void init(int size,int length);
void update(int direction, int length);
void draw(N5110 &lcd, int length);
void add_score();
- int get_score();
- int get_length();
void check_eat(Gamepad &pad);
void check_over(N5110 &lcd);
- int over;
-
+
private:
int _size;
int _x [100];