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 FXOS8700CQQQ
Menus.h
00001 #ifndef MENUS_H 00002 #define MENUS_H 00003 #include "RocketRacer.h" 00004 #include "GameSprites.h" 00005 #include "GameTones.h" 00006 00007 /** Menus class 00008 00009 @brief C++ class containing the game menus and the interface 00010 00011 @version 1.0 00012 00013 @author Omar Alebiary 00014 00015 @date April 2019 00016 00017 @code 00018 00019 #include "mbed.h" 00020 #include "N5110.h" 00021 #include "Gamepad.h" 00022 #include "RocketRacer.h" 00023 00024 // objects 00025 Gamepad pad; 00026 RocketRacer rc; 00027 Menus menus; 00028 00029 00030 00031 int main(){ 00032 00033 00034 setup(); 00035 //displays the welcome menu 00036 menus.welcomeMenu(pad,lcd); 00037 //displays the instructions menu 00038 menus.InstructionsMenu(pad,lcd); 00039 //displays the 2nd instructions menu 00040 menus.SecondInstructionsMenu(lcd); 00041 //displays the loading menu 00042 menus.loading_menu(lcd); 00043 //displays the credits menu 00044 menus.credits(lcd,pad); 00045 //keeps looping to display main menu and method calls 00046 while(1){ 00047 //displays main menu and each related method call when button pressed 00048 menus.drawMenu(lcd,pad); 00049 } 00050 00051 00052 } 00053 00054 @endcode 00055 */ 00056 00057 00058 class Menus{ 00059 00060 public: 00061 /** 00062 * @brief default constructor 00063 */ 00064 Menus(); 00065 /** 00066 * @brief default destructor 00067 */ 00068 ~Menus(); 00069 /** 00070 * @brief welcome menu method 00071 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method 00072 * @param lcd @details calls the lcd object to be passed to the methods called inside this method 00073 */ 00074 void welcomeMenu(Gamepad &pad,N5110 &lcd); 00075 /** 00076 * @brief instructions menu method 00077 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method 00078 * @param lcd @details calls the lcd object to be passed to the methods called inside this method 00079 */ 00080 void InstructionsMenu(Gamepad &pad,N5110 &lcd); 00081 00082 /** 00083 * @brief draw menu method that draws the main menu 00084 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method 00085 * @param lcd @details calls the lcd object to be passed to the methods called inside this method 00086 */ 00087 void drawMenu(N5110 &lcd,Gamepad &pad); 00088 /** 00089 * @brief method that displays credits of the owner of the game 00090 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method 00091 * @param lcd @details calls the lcd object to be passed to the methods called inside this method 00092 */ 00093 void credits(N5110 &lcd,Gamepad &pad); 00094 /** 00095 * @brief method that checks buttons pressed in the main menu 00096 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method 00097 * @param lcd @details calls the lcd object to be passed to the methods called inside this method 00098 */ 00099 void check_button_pressed(Gamepad &pad,N5110 &lcd); 00100 /** 00101 * @brief method that draws loading bar 00102 * @param lcd @details calls the lcd object to be passed to the methods called inside this method 00103 */ 00104 void loading_menu(N5110 &lcd); 00105 /** 00106 * @brief second instructions menu method 00107 * @param lcd @details calls the lcd object to be passed to the methods called inside this method 00108 */ 00109 void SecondInstructionsMenu(N5110 &lcd); 00110 00111 private: 00112 RocketRacer Rocket_Race; 00113 GameTones tone; 00114 00115 00116 }; 00117 00118 #endif
Generated on Mon Jul 18 2022 07:45:10 by
1.7.2