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:
- 38:cc5461dd0369
- Parent:
- 37:524b91130885
- Child:
- 39:41dcf1604fdf
--- a/Game/Game.h Mon Apr 29 15:15:16 2019 +0000
+++ b/Game/Game.h Mon Apr 29 15:23:07 2019 +0000
@@ -62,92 +62,93 @@
Ticker disableY;
Gamepad gamepad;
Renderer renderer;
-
- int readHighScore();
/** Reads the highscore stored in the SD card
*@returns the highscore as an integer
*/
- void writeHighScore(int score);
+ int readHighScore();
/** Writes the new highscore to the SD card
*@param the highscore as an integer
*/
+ void writeHighScore(int score);
+ /** generates initial positions for all cubes
+ */
void resetScene();
- /** generates initial positions for all cubes
+ /** Increments the score by 1
*/
void addScore();
- /** Increments the score by 1
+ /** Resets the score to 0
*/
void resetScore();
- /** Resets the score to 0
- */
- void checkDespawn(Cube *cube);
/** Checks whether a cube needs to be despawned, if it does then the cube will be translated to the far side of the map
*@param A pointer to a cube object
*/
- void checkDeath(Cube *cube);
+ void checkDespawn(Cube *cube);
/** Checks whether a cube is too close to the user and therefore a collision has occured, the game will be stopped if true
*@param A pointer to a cube object
*/
- void cubeToBeRendered(Cube *cube, int cubeIndex);
+ void checkDeath(Cube *cube);
/** Adds the cubes faces to the array of faces to be passed to the renderer
*@param A pointer to a cube object
*@param The integer index of the cubes position in the cube array
*/
- void moveCubes(Cube *cube);
+ void cubeToBeRendered(Cube *cube, int cubeIndex);
/** Translates the cube in the z axis towards the user (speed dependant on score) and left and right depending on the joystick location
*@param A pointer to a cube object
*/
+ void moveCubes(Cube *cube);
+ /** Displays the menu screen if the game has stopeed propting the user to either restart or go to the home menu
+ */
void displayDeathMenu();
- /** Displays the menu screen if the game has stopeed propting the user to either restart or go to the home menu
+ /** Determines the action to be taken depending on the button input once the game has ended
*/
void deathButtonSelections();
- /** Determines the action to be taken depending on the button input once the game has ended
+ /** Determines the action to be taken depending on the button input at the home screen
*/
void homeButtonSelections();
- /** Determines the action to be taken depending on the button input at the home screen
- */
- void disableAButton(bool a);
/** Disables the A button for 300 milliseconds after being pressed to prevent erroneous input from switch bouncing
*@param a boolean indicating whether the button has been pressed
*/
- void disableYButton(bool y);
+ void disableAButton(bool a);
/** Disables the Y button for 300 milliseconds after being pressed to prevent erroneous input from switch bouncing
*@param a boolean indicating whether the button has been pressed
*/
- void disableBButton(bool b);
+ void disableYButton(bool y);
/** Disables the B button for 300 milliseconds after being pressed to prevent erroneous input from switch bouncing
*@param a boolean indicating whether the button has been pressed
*/
- void enableA();
+ void disableBButton(bool b);
/** Is called using a ticker 300 milliseconds after the A button is pressed to re-enable it
*/
+ void enableA();
+ /** Is called using a ticker 300 milliseconds after the Y button is pressed to re-enable it
+ */
void enableY();
- /** Is called using a ticker 300 milliseconds after the Y button is pressed to re-enable it
+ /** Is called using a ticker 300 milliseconds after the B button is pressed to re-enable it
*/
void enableB();
- /** Is called using a ticker 300 milliseconds after the B button is pressed to re-enable it
+ /** Process the joystick and Y, B and A button inputs and store their values in a structure
*/
void processInput();
- /** Process the joystick and Y, B and A button inputs and store their values in a structure
+ /** Begin the execution of the game
*/
void play();
- /** Begin the execution of the game
+ /** Displays the home screen
*/
void homeScreen();
- /** Displays the home screen
+ /** Display the help screens
*/
void helpScreen();
- /** Display the help screens
- */
- void checkNextHelpScreen();
/** Check whether the user has advanced to the next help screen by pressing the A button
*/
+ void checkNextHelpScreen();
+
public:
+ /** The constructor of the Game class and is used to execute the game.
+ */
Game();
- /** The constructor of the Face class which instantiates the game object.
+ /** Executes the main loop
*/
void run();
- /** Executes the main loop
- */
+
};
\ No newline at end of file