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@22:f1811602a817, 2020-05-15 (annotated)
- Committer:
- thestudent
- Date:
- Fri May 15 17:45:20 2020 +0000
- Revision:
- 22:f1811602a817
- Parent:
- 21:32429d8e90ff
- Child:
- 27:da17a102c8d0
Small changes to the design;
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 | 22:f1811602a817 | 23 | |
| thestudent | 21:32429d8e90ff | 24 | /**Make the inital screen |
| thestudent | 21:32429d8e90ff | 25 | */ |
| thestudent | 17:cb208b15be5c | 26 | void first_screen(); |
| thestudent | 22:f1811602a817 | 27 | |
| thestudent | 21:32429d8e90ff | 28 | /**Make the menu screen*/ |
| thestudent | 18:8f7291885e19 | 29 | void menu_screen(); |
| thestudent | 22:f1811602a817 | 30 | |
| thestudent | 21:32429d8e90ff | 31 | /**Get game speed |
| thestudent | 21:32429d8e90ff | 32 | *@return the current game speed |
| thestudent | 21:32429d8e90ff | 33 | */ |
| thestudent | 18:8f7291885e19 | 34 | string get_game_speed(); |
| thestudent | 22:f1811602a817 | 35 | |
| thestudent | 22:f1811602a817 | 36 | /**Make the pause screen |
| thestudent | 22:f1811602a817 | 37 | *@param the players score |
| thestudent | 21:32429d8e90ff | 38 | *@return chosen option |
| thestudent | 21:32429d8e90ff | 39 | */ |
| thestudent | 22:f1811602a817 | 40 | int pause_screen(int score); |
| thestudent | 22:f1811602a817 | 41 | |
| thestudent | 21:32429d8e90ff | 42 | /**Make the game over screen |
| thestudent | 21:32429d8e90ff | 43 | *@param the players score |
| thestudent | 21:32429d8e90ff | 44 | *@return the chosen option |
| thestudent | 21:32429d8e90ff | 45 | */ |
| thestudent | 19:913d123554ee | 46 | int game_over_screen(int score); |
| thestudent | 18:8f7291885e19 | 47 | |
| thestudent | 17:cb208b15be5c | 48 | private: |
| thestudent | 18:8f7291885e19 | 49 | //classes |
| thestudent | 17:cb208b15be5c | 50 | N5110 _lcd; |
| thestudent | 17:cb208b15be5c | 51 | Gamepad _pad; |
| thestudent | 18:8f7291885e19 | 52 | //variables |
| thestudent | 21:32429d8e90ff | 53 | int _arrow_pos;//holds the menu screen arrow position |
| thestudent | 21:32429d8e90ff | 54 | int _arrow_pos_settings; //holds the setting screen arrow position |
| thestudent | 21:32429d8e90ff | 55 | string _game_speed; //holds the game speed |
| thestudent | 21:32429d8e90ff | 56 | char print_speed[6]; // holds the game speed in char |
| thestudent | 22:f1811602a817 | 57 | char buf_score[4];//holds the score |
| thestudent | 16:e2aaef863d7c | 58 | }; |
| thestudent | 16:e2aaef863d7c | 59 | |
| thestudent | 16:e2aaef863d7c | 60 | #endif |