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
snake/snake.h
- Committer:
- 694617778
- Date:
- 2019-04-20
- Revision:
- 9:18b059e5abb9
- Parent:
- 2:934daa65f73d
- Child:
- 11:543c62bed764
File content as of revision 9:18b059e5abb9:
#ifndef SNAKE_H
#define SNAKE_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
class snake
{
public:
snake();
~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();
void check_eat(Gamepad &pad);
void check_over(N5110 &lcd);
private:
int _size;
int _x [100];
int _y [100];
int _score;
int _length;
int ball_x;
int ball_y;
void ball(int length);
};
#endif