Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: SnakevsBlock/SnakevsBlock.h
- Revision:
- 39:210ac915e0a0
- Parent:
- 38:30e4e6191762
- Child:
- 41:4edac50f010d
--- a/SnakevsBlock/SnakevsBlock.h Mon Apr 22 04:24:38 2019 +0000 +++ b/SnakevsBlock/SnakevsBlock.h Mon Apr 22 05:28:37 2019 +0000 @@ -42,6 +42,12 @@ */ void draw(N5110 &lcd, Gamepad &pad); + /** Print Length on the nokia screen + * + * This function is called in draw and just signifies the length to be displayed. + */ + void print_length_on_screen(N5110 &lcd); + /** Get Position * * This function contains the Get Position functions of the otehr libraries used in the game. @@ -64,6 +70,7 @@ int snakex; int snakey; int length; + int velocity; //this is to stop/move the background (food and blocks), when collision occurs at a length greater than 10. int level; int garbage; //to save the angle at the point button A is pressed. float angle; //saves the angle of tilt. @@ -105,6 +112,12 @@ */ void CheckSnakeBlockCollision(Gamepad &pad); + /** Implement velocity alteration. + * + * this is to stop/move the background (food and blocks), when collision occurs at a length greater than 10.lock. + */ + void _set_velocity(); + /** 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.