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.
Diff: main.cpp
- Revision:
- 14:a57a40ff9430
- Parent:
- 13:81573be8fac6
- Child:
- 15:130900e5c268
--- a/main.cpp Mon May 07 19:41:09 2018 +0000
+++ b/main.cpp Tue May 08 13:15:41 2018 +0000
@@ -8,6 +8,12 @@
Date:
*/
+/** The Main class
+* @brief Sends and recives data from the Menu and Engine classes, alters the refresh rate and calls all drawing from other classes
+* @author Andrew J. Moore
+* @date May, 2018
+*/
+
#include "mbed.h"
#include "Gamepad.h"
#include "N5110.h"
@@ -26,13 +32,28 @@
Menu mainMenu;
///////////// prototypes ///////////////
+/** Initialization function */
void init();
+
+/** Initialization function */
void update_game(UserInput input);
+
+/** Draws the game onto the LCD */
void renderGame();
+
+/** Draws the menu onto the LCD */
void renderMenu();
+
+/** Draws the welcome screen onto the LCD */
void welcome();
+
+/** Draws the transition screen onto the LCD */
void transition();
+
+/** Resets game and menu logic once a game over state has been reached */
void reset();
+
+/** Sets the difficulty/refresh rate */
float setDif();
///////////// functions ////////////////
@@ -137,7 +158,7 @@
} else { //Adaptive difficulty
float _delta = gameEngine.getScore();
if (_delta < 25) { //Limits FPS to 25
- return ((1.0f/(_delta + 1)));
+ return ((1.0f/(_delta + 1.0)));
} else {
return (1.0f/25);
}