Snake game snake library
Diff: Snake.h
- Revision:
- 0:2eb4d7e86e2f
- Child:
- 1:93a4cb86f100
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Snake.h Thu May 04 12:01:04 2017 +0000 @@ -0,0 +1,49 @@ +#ifndef SNAKE_H +#define SNAKE_H + + +#include "mbed.h" +#include "N5110.h" +#include "Gamepad.h" +#include "GameEngine.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); + void draw(N5110 &lcd); + void update(Gamepad &pad); + snakePart add_point(int x, int y); + void get_length(); + int _length; + + + + private: + //deque<snakePart> snek; + + int _speed; + int _direction; + int counter; + //int _snakeX[4000]; + //int _snakeY[4000]; + //int _snakeDir[4000]; + int x; + Direction d; + + + }; + + #endif \ No newline at end of file