![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
1
Dependencies: mbed Gamepad N5110
Diff: Snake/Snake.h
- Revision:
- 3:7b28047013d2
- Child:
- 4:c30fb57e0d42
diff -r 1234b0a1a51d -r 7b28047013d2 Snake/Snake.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Snake/Snake.h Thu May 02 06:20:20 2019 +0000 @@ -0,0 +1,59 @@ +#ifndef SNAKE_H +#define SNAKE_H + + +#include "mbed.h" +#include "N5110.h" +#include "Gamepad.h" +#include "Food.h" +/************************Structs************************/ +struct snakePart{ + char _x[4000]; + char _y[4000]; + char _dirc[4000]; + + }; + +/************************Class Def************************/ + +class Snake{ + +/************************Public Vars************************/ + public: + + Snake(); + ~Snake(); + void init(int x, int y, int lenght,int _live); + void drawsnake(N5110 &lcd, Gamepad &pad); + void snakemov(Gamepad &pad); + int dead(N5110 &lcd, Gamepad &pad); + void eat(Gamepad &pad); + void check_WallCollision(N5110 &lcd, Gamepad &pad); + void check_TailCollision(N5110 &lcd, Gamepad &pad); + void drawscore(N5110 &lcd); + void Tone_1(Gamepad &pad); + void game_music(Gamepad &pad); + int _length; + int live; + float waitTime; + float waitExpect; + int _speed; + int Highest_score; + + + +/************************Private Vars************************/ + private: + + int _direction; + int initx; + int inity; + int initl; + int x; + Direction d; + Food _food; + + +}; + + #endif \ No newline at end of file