![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
Diff: Snake/Snake.h
- Revision:
- 41:4edac50f010d
- Parent:
- 39:210ac915e0a0
diff -r 1debed7ec01c -r 4edac50f010d Snake/Snake.h --- a/Snake/Snake.h Mon Apr 22 07:10:52 2019 +0000 +++ b/Snake/Snake.h Tue Apr 23 12:25:49 2019 +0000 @@ -24,31 +24,31 @@ * * This function draws the Snake sprite onto the screen at the specified coordinates. */ - int draw(Gamepad &pad, N5110 &lcd, int length, int level); + void draw(Gamepad &pad, N5110 &lcd, int length, int level); /** Update * * This function updates the Snake sprite position on screen. */ - void update(Direction d,int length, int speed, int* b); + void update(Direction d, int* b); /** Get Position * * This function obtains the coordinate of the top-left pixel in the Snake sprite. */ - Vector2D get_pos(int length); - Vector2D get_pos_before1(int length); - Vector2D get_pos_before2(int length); - Vector2D get_pos_before3(int length); - Vector2D get_pos_before4(int length); - Vector2D get_pos_before5(int length); - Vector2D get_pos_before6(int length); - Vector2D get_pos_before7(int length); - Vector2D get_pos_before8(int length); - Vector2D get_pos_before9(int length); + Vector2D get_pos(); + Vector2D get_pos_before1(); + Vector2D get_pos_before2(); + Vector2D get_pos_before3(); + Vector2D get_pos_before4(); + Vector2D get_pos_before5(); + Vector2D get_pos_before6(); + Vector2D get_pos_before7(); + Vector2D get_pos_before8(); + Vector2D get_pos_before9(); int m; int b[15]; //each element in this array represents the beed number in the snake. - char bufferlevel[14]; //this helps me print the level on screen. + 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.