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.
MenuClasses/StartScreen/StartScreen.h
- Committer:
- AhmedPlaymaker
- Date:
- 2019-05-06
- Revision:
- 84:9950d561fdf8
- Parent:
- 83:329da564799a
- Child:
- 88:1e2e70a484e7
File content as of revision 84:9950d561fdf8:
#ifndef StartScreen_H
#define StartScreen_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Settings.h"
#include "Stats.h"
#include "SDFileSystem.h"
#include "Tutorial.h"
class StartScreen
{
public:
StartScreen();
~StartScreen();
/** Initialise StartScreen
*
* This function initialises the Game Interface and restarts the display.
*/
void init(N5110 *lcd, Gamepad *pad);
/** Initialise objects
*
* This function initialises the objects that are used to functionalise the game.
*/
void object_initialisations();
/** Draw
*
* This function draws the Sprite onto the screen.
*/
void titleScreen();
/** Instruct
*
* This function updates the user about how to progress after the game banner has been displayed..
*/
void instruct();
/** Display userID
*
* This function shows who the author of the game is before showing the menu screen.
*/
void credits();
/** Read Stats
*
* This function just reads the current top level stored in the sd card and saves it for displaying in the menu.
*/
void read_stats(SDFileSystem &sd);
/** Check Back Pressed
*
* This function makes a centralised approach to check when back is pressed in a loop, so that it can be used to exit it and also go to.
* the previous menu option.
*/
bool checkBackPressed();
/** Check Start/A Pressed
*
* This function makes a centralised approach to check when Start/A is pressed in a loop, so that it can be used to exit it and also go to.
* the next menu option.
*/
bool checkStartorAPressed();
/** The Menu Screen
*
* This function obtains the user input on how they want to progress.
*/
void menu();
/** Main Menu
*
* This function displays all the Main Menu contents to the player.
*/
void mainMenu();
/** Draw Selection Arrow
*
* This function draws arrow to select main menu options.
*/
void drawSelectionArrow();
/** Implementing The First Menu Screen
*
* This function just implements the things decided in main menu.
*/
void nextMenu();
/** The Second Menu Screen
*
* This function obtains the user input on the game type they would like to play.
*/
void game_mode();
/** Displaying Mode Options
*
* This function displays game_mode contents.
*/
void selectMode();
/** Selecting the game mode
*
* value of g_mode is changed in this function that allows the choise beteen joystick/motion control..
*/
void scrollModeSelection();
/** Motion Control Instructions
*
* This promts the user to press A to centre position their angle if Motion Control is selected..
*/
void motionControlInstructions();
/** The Third Menu Screen
*
* This function obtains the user input on the game speed that suits them.
*/
void game_speed();
/** Displaying GAME speed Contents
*
* This function just displays game_speed contents.
*/
void selectSpeed();
/** Implementing GS
*
* This function just decides what has to be done next.
*/
void scrollSpeedSelection();
//SETTING THE GAME SPEED AND GAME MODE.
int fps; // this sends over the game speed
int g_mode; //this helps to select between joystick and motion control.
int speed_index;
//MENU OPTIONS INDEX.
int menu_index;
//VARIABLE USED TO DECIDE WEATHER TO SHOW CREDITS.
int showCredits;
//VARIABLE USED TO DECIDE THE WAIT TIME OF THE MENU PAGES.
float controlSensitivity;
//VARIABLES TO TOGGLE BACK AND FORTH BETWEEN MENU OPTIONS.
bool _backPressed; //remembers if back is pressed.
bool _startPressed; //remembers if start is pressed.
private:
//OBJECT DECLARATIONS
Stats _stats;
Settings _settings;
Tutorial _tutorial;
//Pointer to the game pad object pad.
Gamepad *_pad;
//Pointer to the N5110 object lcd.
N5110 *_lcd;
};
#endif