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
Fork of el17dg by
menu/menu.h@27:f05f4e738ba9, 2019-04-08 (annotated)
- Committer:
- Noximilien
- Date:
- Mon Apr 08 14:41:57 2019 +0000
- Revision:
- 27:f05f4e738ba9
- Parent:
- 4:02c63aaa2df9
- Child:
- 28:35af3843de8f
I have created "press START" for the intro pause. Added more comments for the report. Fixed the bug I had in my small star function. Changed some drawsprite functions to new one I made. Slightly simplified the code.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Noximilien | 4:02c63aaa2df9 | 1 | #ifndef MENU_H |
| Noximilien | 4:02c63aaa2df9 | 2 | #define MENU_H |
| Noximilien | 4:02c63aaa2df9 | 3 | |
| Noximilien | 4:02c63aaa2df9 | 4 | enum ScreenOption { //the available options in the menu. |
| Noximilien | 4:02c63aaa2df9 | 5 | ScreenOption_Menu, |
| Noximilien | 4:02c63aaa2df9 | 6 | ScreenOption_Game, |
| Noximilien | 4:02c63aaa2df9 | 7 | ScreenOption_Tutorial, |
| Noximilien | 4:02c63aaa2df9 | 8 | ScreenOption_Settings |
| Noximilien | 4:02c63aaa2df9 | 9 | }; |
| Noximilien | 4:02c63aaa2df9 | 10 | |
| Noximilien | 4:02c63aaa2df9 | 11 | class Menu { |
| Noximilien | 4:02c63aaa2df9 | 12 | public: |
| Noximilien | 27:f05f4e738ba9 | 13 | /** A constructor for Menu*/ |
| Noximilien | 4:02c63aaa2df9 | 14 | Menu(); |
| Noximilien | 4:02c63aaa2df9 | 15 | // Updates menu input, option select and draws menu |
| Noximilien | 4:02c63aaa2df9 | 16 | // Return true if user picked a menu option |
| Noximilien | 4:02c63aaa2df9 | 17 | bool updateAndDraw(); |
| Noximilien | 4:02c63aaa2df9 | 18 | |
| Noximilien | 4:02c63aaa2df9 | 19 | ScreenOption getCurrentScreenSelection(); |
| Noximilien | 4:02c63aaa2df9 | 20 | |
| Noximilien | 4:02c63aaa2df9 | 21 | private: |
| Noximilien | 4:02c63aaa2df9 | 22 | void pointerPosition(int menu_number); |
| Noximilien | 4:02c63aaa2df9 | 23 | void drawPointer(); |
| Noximilien | 4:02c63aaa2df9 | 24 | int current_option; // NOTE to self: can declare variables in classes. |
| Noximilien | 4:02c63aaa2df9 | 25 | }; |
| Noximilien | 4:02c63aaa2df9 | 26 | |
| Noximilien | 4:02c63aaa2df9 | 27 | |
| Noximilien | 4:02c63aaa2df9 | 28 | #endif |
