![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
Diff: SnakevsBlock/SnakevsBlock.h
- Revision:
- 13:9785f2404045
- Parent:
- 12:1e601b176437
- Child:
- 16:7b474f873683
--- a/SnakevsBlock/SnakevsBlock.h Tue Apr 02 17:06:22 2019 +0000 +++ b/SnakevsBlock/SnakevsBlock.h Wed Apr 03 17:51:19 2019 +0000 @@ -52,6 +52,7 @@ int blocknum; int srn; int send; //makes sure that the block number is only updated when send is activated. + int speed; //makes sure that snake only moves if not colliding to block walls //int memory; //this remembers the previous y pos of the block. //int blocknumt; // this is also a memeory number to make sure length doesnt't keep decreasing by itself @@ -78,5 +79,11 @@ * This function checks if the Snake has come into contact with any Block. */ void CheckSnakeBlockCollision(Gamepad &pad); + + /** Check for Snake and Block Sides collision + * + * This function checks if the Snake has come into contact with any the sides of the block and stops it moving. + */ + void CheckSnakeBlockSidesCollision(Gamepad &pad, Direction d); }; #endif \ No newline at end of file