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.
Menu/Menu.h@21:32429d8e90ff, 2020-05-12 (annotated)
- Committer:
- thestudent
- Date:
- Tue May 12 15:12:59 2020 +0000
- Revision:
- 21:32429d8e90ff
- Parent:
- 19:913d123554ee
- Child:
- 22:f1811602a817
Final version
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| thestudent | 16:e2aaef863d7c | 1 | #ifndef MENU_H |
| thestudent | 16:e2aaef863d7c | 2 | #define MENU_H |
| thestudent | 17:cb208b15be5c | 3 | #include "N5110.h" |
| thestudent | 17:cb208b15be5c | 4 | #include "Gamepad.h" |
| thestudent | 17:cb208b15be5c | 5 | #include "Objects.h" |
| thestudent | 21:32429d8e90ff | 6 | |
| thestudent | 21:32429d8e90ff | 7 | /**Menu class |
| thestudent | 21:32429d8e90ff | 8 | *@brief Makes menu and game screens |
| thestudent | 21:32429d8e90ff | 9 | *@author Arturs Kozlovskis |
| thestudent | 21:32429d8e90ff | 10 | *@date April,2020 |
| thestudent | 21:32429d8e90ff | 11 | */ |
| thestudent | 21:32429d8e90ff | 12 | |
| thestudent | 17:cb208b15be5c | 13 | class Menu |
| thestudent | 17:cb208b15be5c | 14 | { |
| thestudent | 17:cb208b15be5c | 15 | public: |
| thestudent | 18:8f7291885e19 | 16 | //functions |
| thestudent | 21:32429d8e90ff | 17 | |
| thestudent | 21:32429d8e90ff | 18 | /**Constructor |
| thestudent | 21:32429d8e90ff | 19 | *@param LCD' object |
| thestudent | 21:32429d8e90ff | 20 | *@param Gamepad's object |
| thestudent | 21:32429d8e90ff | 21 | */ |
| thestudent | 17:cb208b15be5c | 22 | Menu(N5110 &lcd,Gamepad &pad); |
| thestudent | 21:32429d8e90ff | 23 | /**Make the inital screen |
| thestudent | 21:32429d8e90ff | 24 | */ |
| thestudent | 17:cb208b15be5c | 25 | void first_screen(); |
| thestudent | 21:32429d8e90ff | 26 | /**Make the menu screen*/ |
| thestudent | 18:8f7291885e19 | 27 | void menu_screen(); |
| thestudent | 21:32429d8e90ff | 28 | /**Get game speed |
| thestudent | 21:32429d8e90ff | 29 | *@return the current game speed |
| thestudent | 21:32429d8e90ff | 30 | */ |
| thestudent | 18:8f7291885e19 | 31 | string get_game_speed(); |
| thestudent | 21:32429d8e90ff | 32 | /**Meke the pause screen |
| thestudent | 21:32429d8e90ff | 33 | *@return chosen option |
| thestudent | 21:32429d8e90ff | 34 | */ |
| thestudent | 18:8f7291885e19 | 35 | int pause_screen(); |
| thestudent | 21:32429d8e90ff | 36 | /**Make the game over screen |
| thestudent | 21:32429d8e90ff | 37 | *@param the players score |
| thestudent | 21:32429d8e90ff | 38 | *@return the chosen option |
| thestudent | 21:32429d8e90ff | 39 | */ |
| thestudent | 19:913d123554ee | 40 | int game_over_screen(int score); |
| thestudent | 18:8f7291885e19 | 41 | |
| thestudent | 17:cb208b15be5c | 42 | private: |
| thestudent | 18:8f7291885e19 | 43 | //classes |
| thestudent | 17:cb208b15be5c | 44 | N5110 _lcd; |
| thestudent | 17:cb208b15be5c | 45 | Gamepad _pad; |
| thestudent | 18:8f7291885e19 | 46 | //variables |
| thestudent | 21:32429d8e90ff | 47 | int _arrow_pos;//holds the menu screen arrow position |
| thestudent | 21:32429d8e90ff | 48 | int _arrow_pos_settings; //holds the setting screen arrow position |
| thestudent | 21:32429d8e90ff | 49 | string _game_speed; //holds the game speed |
| thestudent | 21:32429d8e90ff | 50 | char print_speed[6]; // holds the game speed in char |
| thestudent | 16:e2aaef863d7c | 51 | }; |
| thestudent | 16:e2aaef863d7c | 52 | |
| thestudent | 16:e2aaef863d7c | 53 | #endif |