contains my game for the embedded systems project 2645
Dependencies: mbed FXOS8700CQQQ
GameMenus/Menus.h@28:39607fb67e88, 2019-04-24 (annotated)
- Committer:
- OmarAlebiary
- Date:
- Wed Apr 24 10:19:07 2019 +0000
- Revision:
- 28:39607fb67e88
- Child:
- 29:e660274d8222
added doxygen comments to RocketRacer.h
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
OmarAlebiary | 28:39607fb67e88 | 1 | #ifndef MENUS_H |
OmarAlebiary | 28:39607fb67e88 | 2 | #define MENUS_H |
OmarAlebiary | 28:39607fb67e88 | 3 | #include "RocketRacer.h" |
OmarAlebiary | 28:39607fb67e88 | 4 | #include "GameSprites.h" |
OmarAlebiary | 28:39607fb67e88 | 5 | #include "GameTones.h" |
OmarAlebiary | 28:39607fb67e88 | 6 | |
OmarAlebiary | 28:39607fb67e88 | 7 | /** Menus class |
OmarAlebiary | 28:39607fb67e88 | 8 | |
OmarAlebiary | 28:39607fb67e88 | 9 | @brief C++ class containing the game menu and the interface |
OmarAlebiary | 28:39607fb67e88 | 10 | |
OmarAlebiary | 28:39607fb67e88 | 11 | @version 1.0 |
OmarAlebiary | 28:39607fb67e88 | 12 | |
OmarAlebiary | 28:39607fb67e88 | 13 | @author Omar Alebiary |
OmarAlebiary | 28:39607fb67e88 | 14 | |
OmarAlebiary | 28:39607fb67e88 | 15 | @date April 2019 |
OmarAlebiary | 28:39607fb67e88 | 16 | |
OmarAlebiary | 28:39607fb67e88 | 17 | @code |
OmarAlebiary | 28:39607fb67e88 | 18 | |
OmarAlebiary | 28:39607fb67e88 | 19 | #include "mbed.h" |
OmarAlebiary | 28:39607fb67e88 | 20 | #include "N5110.h" |
OmarAlebiary | 28:39607fb67e88 | 21 | #include "Gamepad.h" |
OmarAlebiary | 28:39607fb67e88 | 22 | #include "RocketRacer.h" |
OmarAlebiary | 28:39607fb67e88 | 23 | |
OmarAlebiary | 28:39607fb67e88 | 24 | // objects |
OmarAlebiary | 28:39607fb67e88 | 25 | Gamepad pad; |
OmarAlebiary | 28:39607fb67e88 | 26 | RocketRacer rc; |
OmarAlebiary | 28:39607fb67e88 | 27 | Menus menus; |
OmarAlebiary | 28:39607fb67e88 | 28 | |
OmarAlebiary | 28:39607fb67e88 | 29 | |
OmarAlebiary | 28:39607fb67e88 | 30 | |
OmarAlebiary | 28:39607fb67e88 | 31 | int main(){ |
OmarAlebiary | 28:39607fb67e88 | 32 | |
OmarAlebiary | 28:39607fb67e88 | 33 | |
OmarAlebiary | 28:39607fb67e88 | 34 | setup(); |
OmarAlebiary | 28:39607fb67e88 | 35 | menus.welcomeMenu(pad,lcd); |
OmarAlebiary | 28:39607fb67e88 | 36 | menus.InstructionsMenu(pad,lcd); |
OmarAlebiary | 28:39607fb67e88 | 37 | //keeps looping untill the player loses |
OmarAlebiary | 28:39607fb67e88 | 38 | while(1){ |
OmarAlebiary | 28:39607fb67e88 | 39 | Rocket_Racer.Game_Loop(lcd,pad); |
OmarAlebiary | 28:39607fb67e88 | 40 | } |
OmarAlebiary | 28:39607fb67e88 | 41 | |
OmarAlebiary | 28:39607fb67e88 | 42 | |
OmarAlebiary | 28:39607fb67e88 | 43 | } |
OmarAlebiary | 28:39607fb67e88 | 44 | |
OmarAlebiary | 28:39607fb67e88 | 45 | @endcode |
OmarAlebiary | 28:39607fb67e88 | 46 | */ |
OmarAlebiary | 28:39607fb67e88 | 47 | |
OmarAlebiary | 28:39607fb67e88 | 48 | |
OmarAlebiary | 28:39607fb67e88 | 49 | class Menus{ |
OmarAlebiary | 28:39607fb67e88 | 50 | |
OmarAlebiary | 28:39607fb67e88 | 51 | public: |
OmarAlebiary | 28:39607fb67e88 | 52 | /** |
OmarAlebiary | 28:39607fb67e88 | 53 | * @brief default constructor |
OmarAlebiary | 28:39607fb67e88 | 54 | */ |
OmarAlebiary | 28:39607fb67e88 | 55 | Menus(); |
OmarAlebiary | 28:39607fb67e88 | 56 | /** |
OmarAlebiary | 28:39607fb67e88 | 57 | * @brief welcome menu method |
OmarAlebiary | 28:39607fb67e88 | 58 | * @param pad @details calls the Gamepad object to be passed to the methods called inside this method |
OmarAlebiary | 28:39607fb67e88 | 59 | * @param lcd @details calls the lcd object to be passed to the methods called inside this method |
OmarAlebiary | 28:39607fb67e88 | 60 | */ |
OmarAlebiary | 28:39607fb67e88 | 61 | void welcomeMenu(Gamepad &pad,N5110 &lcd); |
OmarAlebiary | 28:39607fb67e88 | 62 | /** |
OmarAlebiary | 28:39607fb67e88 | 63 | * @brief instructions menu method |
OmarAlebiary | 28:39607fb67e88 | 64 | * @param pad @details calls the Gamepad object to be passed to the methods called inside this method |
OmarAlebiary | 28:39607fb67e88 | 65 | * @param lcd @details calls the lcd object to be passed to the methods called inside this method |
OmarAlebiary | 28:39607fb67e88 | 66 | */ |
OmarAlebiary | 28:39607fb67e88 | 67 | void InstructionsMenu(Gamepad &pad,N5110 &lcd); |
OmarAlebiary | 28:39607fb67e88 | 68 | |
OmarAlebiary | 28:39607fb67e88 | 69 | /** |
OmarAlebiary | 28:39607fb67e88 | 70 | * @brief draw menu method that draws the main menu |
OmarAlebiary | 28:39607fb67e88 | 71 | * @param pad @details calls the Gamepad object to be passed to the methods called inside this method |
OmarAlebiary | 28:39607fb67e88 | 72 | * @param lcd @details calls the lcd object to be passed to the methods called inside this method |
OmarAlebiary | 28:39607fb67e88 | 73 | */ |
OmarAlebiary | 28:39607fb67e88 | 74 | void drawMenu(N5110 &lcd,Gamepad &pad); |
OmarAlebiary | 28:39607fb67e88 | 75 | /** |
OmarAlebiary | 28:39607fb67e88 | 76 | * @brief method that displays credits of the owner of the game |
OmarAlebiary | 28:39607fb67e88 | 77 | * @param pad @details calls the Gamepad object to be passed to the methods called inside this method |
OmarAlebiary | 28:39607fb67e88 | 78 | * @param lcd @details calls the lcd object to be passed to the methods called inside this method |
OmarAlebiary | 28:39607fb67e88 | 79 | */ |
OmarAlebiary | 28:39607fb67e88 | 80 | void credits(N5110 &lcd,Gamepad &pad); |
OmarAlebiary | 28:39607fb67e88 | 81 | /** |
OmarAlebiary | 28:39607fb67e88 | 82 | * @brief method that checks buttons pressed in the main menu |
OmarAlebiary | 28:39607fb67e88 | 83 | * @param pad @details calls the Gamepad object to be passed to the methods called inside this method |
OmarAlebiary | 28:39607fb67e88 | 84 | * @param lcd @details calls the lcd object to be passed to the methods called inside this method |
OmarAlebiary | 28:39607fb67e88 | 85 | */ |
OmarAlebiary | 28:39607fb67e88 | 86 | void check_button_pressed(Gamepad &pad,N5110 &lcd); |
OmarAlebiary | 28:39607fb67e88 | 87 | /** |
OmarAlebiary | 28:39607fb67e88 | 88 | * @brief method that draws loading bar |
OmarAlebiary | 28:39607fb67e88 | 89 | * @param lcd @details calls the lcd object to be passed to the methods called inside this method |
OmarAlebiary | 28:39607fb67e88 | 90 | */ |
OmarAlebiary | 28:39607fb67e88 | 91 | void loading_menu(N5110 &lcd); |
OmarAlebiary | 28:39607fb67e88 | 92 | |
OmarAlebiary | 28:39607fb67e88 | 93 | private: |
OmarAlebiary | 28:39607fb67e88 | 94 | RocketRacer Rocket_Race; |
OmarAlebiary | 28:39607fb67e88 | 95 | GameTones tone; |
OmarAlebiary | 28:39607fb67e88 | 96 | |
OmarAlebiary | 28:39607fb67e88 | 97 | |
OmarAlebiary | 28:39607fb67e88 | 98 | }; |
OmarAlebiary | 28:39607fb67e88 | 99 | |
OmarAlebiary | 28:39607fb67e88 | 100 | #endif |