Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: Game/Game.h
- Revision:
- 7:8d381315f72c
- Parent:
- 6:a2c72def99f9
--- a/Game/Game.h Tue May 26 18:14:03 2020 +0000 +++ b/Game/Game.h Tue May 26 22:53:42 2020 +0000 @@ -23,8 +23,8 @@ int fruitX [16]; int fruitY [9]; int score; - int a; //used to select the direction based ont what button is pressed - int ntail; //used to increase lenght of the tail + int a; //used to select the direction based ont what button is pressed + int ntail; //used to increase lenght of the tail int k; int rx; int ry; @@ -35,14 +35,41 @@ vector <int> y_pos; public: + /**Constructor*/ + Game();//initialises the game - Game(); - + /**Reguates the diretion of movement of the snake + * @param Gamepad class object + */ void movement(Gamepad &pad); + + /**Regulates the way the snake moves + */ void updating_position(); + + /**Get value of which button is pressed + *@ param N5110 class object + *@ param Gamepad class object + * @return death value (0,1,2) + */ int death(N5110 &lcd,Gamepad &pad); + + /**Draws the game field, the snake and the fruit + *@ param N5110 class object + *@ param Gamepad class object + */ void draw(N5110 &lcd,Gamepad &pad); + + /**Executes what happens when you die + *@ param N5110 class object + *@ param Gamepad class object + */ void gameover(N5110 &lcd,Gamepad &pad); + + /**Increases your points and your lenght when you score + *@ param N5110 class object + *@ param Gamepad class object + */ void point(N5110 &lcd,Gamepad &pad); };