Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: GameObjects/Snake/Snake.h
- Revision:
- 71:4bd2b27693f3
- Parent:
- 70:7caab8069b9b
- Child:
- 77:5c6bd659c32d
--- a/GameObjects/Snake/Snake.h Sat May 04 20:48:10 2019 +0000 +++ b/GameObjects/Snake/Snake.h Sat May 04 22:09:59 2019 +0000 @@ -37,6 +37,24 @@ * This function updates the Snake sprite position on screen. */ void update(Direction d, int* b); + + /** Chain Snake Together + * + * This function makes all of the snake beeds chained together by making the lower ones drag towards where the top one was in the previous loop + */ + void chainSnakeTogether(int* b); + + /** Moove Snake + * + * This function makes the controls of W/E directions only exclusive to the top beed in the snake + */ + void mooveSnake(Direction d, int* b); + + /** Set Snake Limits + * + * This function makes sure that the snake stays where it is when it ate food and does not travel off the screen. + */ + void _setSnakeLimits(); /** Get Position * @@ -45,7 +63,7 @@ Vector2D get_pos(int snakeIndex); int m; - int b[15]; //each element in this array represents the beed number in the snake. + int b[10]; //each element in this array represents the beed number in the snake. private: int _speed; //this is the speed of the snake flowing in the x axis.