Snake game snake library
Snake.h
- Committer:
- Nefos
- Date:
- 2017-05-05
- Revision:
- 5:449858a54971
- Parent:
- 4:c74ec3f409f9
- Child:
- 6:cc8d2088f490
File content as of revision 5:449858a54971:
#ifndef SNAKE_H #define SNAKE_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "Food.h" #include <deque> struct snakePart{ char _x[4000]; char _y[4000]; char _dir[4000]; }; class Snake { public: Snake(); ~Snake(); void init(int x, int y, int lenght,int _live); void draw(N5110 &lcd); void update(Gamepad &pad); void deadSnake(N5110 &lcd); void add_point(); void checkWallCollision(N5110 &lcd); void checkTailCollision(N5110 &lcd); int _length; int live; float waitTime; float waitCount; private: //deque<snakePart> snek; int _speed; int _direction; int startx; int starty; int startl; //int _snakeX[4000]; //int _snakeY[4000]; //int _snakeDir[4000]; int x; Direction d; Food _food; //Gamepad pad; //GameEngine engine; }; #endif