Snake game snake library
Diff: Snake.h
- Revision:
- 6:cc8d2088f490
- Parent:
- 5:449858a54971
- Child:
- 7:a2f426a37e60
--- a/Snake.h Fri May 05 14:51:27 2017 +0000 +++ b/Snake.h Fri May 05 15:06:54 2017 +0000 @@ -6,18 +6,20 @@ #include "N5110.h" #include "Gamepad.h" #include "Food.h" -#include <deque> +/************************Structs************************/ struct snakePart{ char _x[4000]; char _y[4000]; char _dir[4000]; }; - + +/************************Class Def************************/ -class Snake -{ +class Snake{ + +/************************Public Vars************************/ public: Snake(); @@ -26,7 +28,7 @@ void draw(N5110 &lcd); void update(Gamepad &pad); void deadSnake(N5110 &lcd); - void add_point(); + void addPoint(); void checkWallCollision(N5110 &lcd); void checkTailCollision(N5110 &lcd); int _length; @@ -37,28 +39,20 @@ - +/************************Private Vars************************/ 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 \ No newline at end of file