Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: GameObjects/Snake/Snake.h
- Revision:
- 69:55e309da7efd
- Parent:
- 68:b9cfd27987ac
- Child:
- 70:7caab8069b9b
--- a/GameObjects/Snake/Snake.h Sat May 04 16:56:04 2019 +0000 +++ b/GameObjects/Snake/Snake.h Sat May 04 17:18:44 2019 +0000 @@ -8,36 +8,36 @@ class Snake { - public: - - +public: + + Snake(); ~Snake(); - + /** Initialise Snake * * This function initalises the Snake library. */ void init(int length, int speed); - + /** Draw * * This function draws the Snake sprite onto the screen at the specified coordinates. */ void draw(N5110 &lcd, int length, int level); - + /** Set Position * * This function sets a position for where the snake should spawn. */ void set_pos(Vector2D p); - + /** Update * * This function updates the Snake sprite position on screen. */ void update(Direction d, int* b); - + /** Get Position * * This function obtains the coordinate of the top-left pixel in the Snake sprite. @@ -54,8 +54,8 @@ Vector2D get_pos_before9(); int m; int b[15]; //each element in this array represents the beed number in the snake. - - private: + +private: int _speed; //this is the speed of the snake flowing in the x axis. int _x[15]; //each element in this array represents the x position of each beed in the snake. int _y[15]; //each element in this array represents the y position of each beed in the snake.