Mochu Yao explorer game
Dependencies: mbed
menu/Menu.h@26:4d193529b447, 2020-04-28 (annotated)
- Committer:
- el17my
- Date:
- Tue Apr 28 17:39:26 2020 +0000
- Revision:
- 26:4d193529b447
- Parent:
- 23:7be9701fc1b8
- Child:
- 27:354d91d59b6d
4.29
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el17my | 21:349c70c8a7de | 1 | #ifndef MENU_H |
el17my | 21:349c70c8a7de | 2 | #define MENU_H |
el17my | 21:349c70c8a7de | 3 | |
el17my | 21:349c70c8a7de | 4 | #include "mbed.h" |
el17my | 21:349c70c8a7de | 5 | #include "N5110.h" |
el17my | 21:349c70c8a7de | 6 | #include "Gamepad.h" |
el17my | 21:349c70c8a7de | 7 | #include "Gameengine.h" |
el17my | 21:349c70c8a7de | 8 | //*using the UpDown_counter example in class 201. |
el17my | 21:349c70c8a7de | 9 | struct State { |
el17my | 23:7be9701fc1b8 | 10 | int output; |
el17my | 23:7be9701fc1b8 | 11 | int next_state[4]; |
el17my | 21:349c70c8a7de | 12 | }; |
el17my | 21:349c70c8a7de | 13 | |
el17my | 21:349c70c8a7de | 14 | /** Menu class |
el17my | 23:7be9701fc1b8 | 15 | * @ 1 build three page to choose |
el17my | 23:7be9701fc1b8 | 16 | * @ 2 build a good welcome_page |
el17my | 23:7be9701fc1b8 | 17 | * @ 3 connect with the gamepad and makesure the game is working |
el17my | 23:7be9701fc1b8 | 18 | * @ date April 27th 2020 |
el17my | 23:7be9701fc1b8 | 19 | * @ author Yaomochu |
el17my | 26:4d193529b447 | 20 | */ |
el17my | 21:349c70c8a7de | 21 | |
el17my | 21:349c70c8a7de | 22 | |
el17my | 21:349c70c8a7de | 23 | class Menu { |
el17my | 21:349c70c8a7de | 24 | public: |
el17my | 21:349c70c8a7de | 25 | Menu(); |
el17my | 21:349c70c8a7de | 26 | ~Menu(); |
el17my | 21:349c70c8a7de | 27 | void init(); |
el17my | 22:f8ba0ab7465c | 28 | void run_engine(N5110 &lcd, Gamepad &gamepad); |
el17my | 22:f8ba0ab7465c | 29 | void run_game(N5110 &lcd, Gamepad &gamepad); |
el17my | 22:f8ba0ab7465c | 30 | |
el17my | 22:f8ba0ab7465c | 31 | |
el17my | 22:f8ba0ab7465c | 32 | private: |
el17my | 21:349c70c8a7de | 33 | void display_page1(N5110 &lcd, Gamepad &gamepad); |
el17my | 21:349c70c8a7de | 34 | void display_page2(N5110 &lcd, Gamepad &gamepad); |
el17my | 22:f8ba0ab7465c | 35 | void get_output(N5110 &lcd, Gamepad &gamepad); |
el17my | 21:349c70c8a7de | 36 | void get_input(bool start, bool back, bool b); |
el17my | 21:349c70c8a7de | 37 | Gameengine _game_engine; |
el17my | 21:349c70c8a7de | 38 | int _input_value; |
el17my | 21:349c70c8a7de | 39 | int _output; |
el17my | 21:349c70c8a7de | 40 | int _state; |
el17my | 21:349c70c8a7de | 41 | }; |
el17my | 21:349c70c8a7de | 42 | #endif |
el17my | 21:349c70c8a7de | 43 | |
el17my | 21:349c70c8a7de | 44 |