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.
Menus/Menu.h@4:0f2006e9c8f8, 2019-05-09 (annotated)
- Committer:
 - jiaxinZHOU
 - Date:
 - Thu May 09 02:37:14 2019 +0000
 - Revision:
 - 4:0f2006e9c8f8
 - Parent:
 - 2:c7976a633ba0
 
final
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| jiaxinZHOU | 0:07c4fef6c0af | 1 | #ifndef MENU_H | 
| jiaxinZHOU | 0:07c4fef6c0af | 2 | #define MENU_H | 
| jiaxinZHOU | 0:07c4fef6c0af | 3 | |
| jiaxinZHOU | 0:07c4fef6c0af | 4 | #include "mbed.h" | 
| jiaxinZHOU | 0:07c4fef6c0af | 5 | #include "N5110.h" | 
| jiaxinZHOU | 0:07c4fef6c0af | 6 | #include "Gamepad.h" | 
| jiaxinZHOU | 0:07c4fef6c0af | 7 | |
| jiaxinZHOU | 2:c7976a633ba0 | 8 | /** Menu Class | 
| jiaxinZHOU | 2:c7976a633ba0 | 9 | @brief Class for settings and start game | 
| jiaxinZHOU | 1:538386e72e40 | 10 | @author Zhou Jiaxin | 
| jiaxinZHOU | 1:538386e72e40 | 11 | @date 8th May 2019 | 
| jiaxinZHOU | 1:538386e72e40 | 12 | */ | 
| jiaxinZHOU | 1:538386e72e40 | 13 | |
| jiaxinZHOU | 0:07c4fef6c0af | 14 | class Menu | 
| jiaxinZHOU | 0:07c4fef6c0af | 15 | { | 
| jiaxinZHOU | 0:07c4fef6c0af | 16 | public: | 
| jiaxinZHOU | 1:538386e72e40 | 17 | /** Constructor */ | 
| jiaxinZHOU | 0:07c4fef6c0af | 18 | Menu(); | 
| jiaxinZHOU | 1:538386e72e40 | 19 | /** Destructor */ | 
| jiaxinZHOU | 0:07c4fef6c0af | 20 | ~Menu(); | 
| jiaxinZHOU | 1:538386e72e40 | 21 | |
| jiaxinZHOU | 1:538386e72e40 | 22 | /** | 
| jiaxinZHOU | 1:538386e72e40 | 23 | * @brief initial all the parameter for the snake and food. | 
| jiaxinZHOU | 1:538386e72e40 | 24 | * @param select @details is used to switch the menu. | 
| jiaxinZHOU | 1:538386e72e40 | 25 | * @param Gamepad *pad @details pointer to the gamepad object in main, address of this pointer is saved to make availability to the entire class, without passing address to each function. | 
| jiaxinZHOU | 1:538386e72e40 | 26 | */ | 
| jiaxinZHOU | 0:07c4fef6c0af | 27 | int input(int select,Gamepad &pad); | 
| jiaxinZHOU | 1:538386e72e40 | 28 | /** | 
| jiaxinZHOU | 4:0f2006e9c8f8 | 29 | * @brief Main menu for settings and start game. | 
| jiaxinZHOU | 1:538386e72e40 | 30 | * @param N5110 *lcd @details pointer to the N5110 object in main, address of this pointer is saved to make availability to the entire class, without passing address to each function. | 
| jiaxinZHOU | 1:538386e72e40 | 31 | * @param Gamepad *pad @details pointer to the gamepad object in main, address of this pointer is saved to make availability to the entire class, without passing address to each function. | 
| jiaxinZHOU | 1:538386e72e40 | 32 | */ | 
| jiaxinZHOU | 0:07c4fef6c0af | 33 | void menus(N5110 &lcd,Gamepad &pad); | 
| jiaxinZHOU | 1:538386e72e40 | 34 | /** | 
| jiaxinZHOU | 4:0f2006e9c8f8 | 35 | * @brief select difiiculty. | 
| jiaxinZHOU | 1:538386e72e40 | 36 | * @param N5110 *lcd @details pointer to the N5110 object in main, address of this pointer is saved to make availability to the entire class, without passing address to each function. | 
| jiaxinZHOU | 1:538386e72e40 | 37 | * @param Gamepad *pad @details pointer to the gamepad object in main, address of this pointer is saved to make availability to the entire class, without passing address to each function. | 
| jiaxinZHOU | 1:538386e72e40 | 38 | * @returns fps @details is the frame per second, with higher fps means higher difficulty. | 
| jiaxinZHOU | 1:538386e72e40 | 39 | */ | 
| jiaxinZHOU | 0:07c4fef6c0af | 40 | int difficulty(N5110 &lcd,Gamepad &pad); | 
| jiaxinZHOU | 0:07c4fef6c0af | 41 | |
| jiaxinZHOU | 0:07c4fef6c0af | 42 | |
| jiaxinZHOU | 0:07c4fef6c0af | 43 | private: | 
| jiaxinZHOU | 0:07c4fef6c0af | 44 | int sel; | 
| jiaxinZHOU | 0:07c4fef6c0af | 45 | int go_on; | 
| jiaxinZHOU | 0:07c4fef6c0af | 46 | int _fps; | 
| jiaxinZHOU | 0:07c4fef6c0af | 47 | |
| jiaxinZHOU | 0:07c4fef6c0af | 48 | |
| jiaxinZHOU | 0:07c4fef6c0af | 49 | }; | 
| jiaxinZHOU | 0:07c4fef6c0af | 50 | |
| jiaxinZHOU | 0:07c4fef6c0af | 51 | #endif |