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
Menus/Menus.h@15:fa5282fcd134, 2019-04-19 (annotated)
- Committer:
- el17mcd
- Date:
- Fri Apr 19 15:58:51 2019 +0000
- Revision:
- 15:fa5282fcd134
- Child:
- 16:a2c945279b79
! New Menus class that holds the menus for the game. Settings menu to toggle sound, change contrast and number of lives players start with.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el17mcd | 15:fa5282fcd134 | 1 | #ifndef MENUS |
| el17mcd | 15:fa5282fcd134 | 2 | #define MENUS |
| el17mcd | 15:fa5282fcd134 | 3 | |
| el17mcd | 15:fa5282fcd134 | 4 | #include "mbed.h" |
| el17mcd | 15:fa5282fcd134 | 5 | #include "N5110.h" |
| el17mcd | 15:fa5282fcd134 | 6 | #include "Gamepad.h" |
| el17mcd | 15:fa5282fcd134 | 7 | #include "Graphics.h" |
| el17mcd | 15:fa5282fcd134 | 8 | |
| el17mcd | 15:fa5282fcd134 | 9 | class Menus |
| el17mcd | 15:fa5282fcd134 | 10 | { |
| el17mcd | 15:fa5282fcd134 | 11 | public: |
| el17mcd | 15:fa5282fcd134 | 12 | |
| el17mcd | 15:fa5282fcd134 | 13 | Menus(); |
| el17mcd | 15:fa5282fcd134 | 14 | ~Menus(); |
| el17mcd | 15:fa5282fcd134 | 15 | void start_up_screen(Graphics &graphics, N5110 &lcd, Gamepad &pad); |
| el17mcd | 15:fa5282fcd134 | 16 | void main_menu(Graphics &graphics, N5110 &lcd, Gamepad &pad); |
| el17mcd | 15:fa5282fcd134 | 17 | bool get_mute(); |
| el17mcd | 15:fa5282fcd134 | 18 | int get_lives(); |
| el17mcd | 15:fa5282fcd134 | 19 | |
| el17mcd | 15:fa5282fcd134 | 20 | private: |
| el17mcd | 15:fa5282fcd134 | 21 | |
| el17mcd | 15:fa5282fcd134 | 22 | void _start_up_visuals(Graphics &graphics, N5110 &lcd, Gamepad &pad); |
| el17mcd | 15:fa5282fcd134 | 23 | void _read_inputs(Gamepad &pad); |
| el17mcd | 15:fa5282fcd134 | 24 | void _controls(N5110 &lcd, Gamepad &pad); |
| el17mcd | 15:fa5282fcd134 | 25 | void _scores(N5110 &lcd, Gamepad &pad); |
| el17mcd | 15:fa5282fcd134 | 26 | void _settings(N5110 &lcd, Gamepad &pad); |
| el17mcd | 15:fa5282fcd134 | 27 | void _mute_contrast(N5110 &lcd, Gamepad &pad); |
| el17mcd | 15:fa5282fcd134 | 28 | |
| el17mcd | 15:fa5282fcd134 | 29 | int _counter; |
| el17mcd | 15:fa5282fcd134 | 30 | int _lives; |
| el17mcd | 15:fa5282fcd134 | 31 | bool _mute; |
| el17mcd | 15:fa5282fcd134 | 32 | float _contrast; |
| el17mcd | 15:fa5282fcd134 | 33 | float _score; |
| el17mcd | 15:fa5282fcd134 | 34 | }; |
| el17mcd | 15:fa5282fcd134 | 35 | |
| el17mcd | 15:fa5282fcd134 | 36 | #endif // MENUS |