ELEC2645 (2018/19) / Mbed 2 deprecated el17apb

Dependencies:   mbed Gamepad N5110

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Menu.h Source File

Menu.h

00001 #ifndef MENU_H
00002 #define MENU_H
00003 
00004 #include "mbed.h"
00005 #include "Gamepad.h"
00006 #include "N5110.h"
00007 
00008 /** Menu Class
00009  * @brief class for containing menu screens
00010  * @author Adam P. Baker
00011  * @date 9 May 2019
00012  */
00013 class Menu
00014 {
00015 public:
00016     /** Constructor */
00017     Menu();
00018 
00019     /** Deconstructor */
00020     ~Menu();
00021 
00022     /** intialises */
00023     void init();
00024 
00025     /** runs the title sequence
00026     *@param N5110 class which controlls lcd screen
00027     *@param Gamepad class for working with the gamepad
00028     */
00029     void title_intro(N5110 &lcd, Gamepad &pad);
00030 
00031     /**holds title screen and flashes 'press start'
00032     *@param N5110 class which controlls lcd screen
00033     *@param Gamepad class for working with the gamepad
00034     *@returns _start (1 when pressed, else 0) (int)
00035     */
00036     int press_start(N5110 &lcd, Gamepad &pad);
00037 
00038     /** displays main menu screen and takes in input to select next state
00039     *@param Gamepad class for working with the gamepad
00040     *@param N5110 class which controlls lcd screen
00041     *@returns _input (1 when pressed, else 0) (int)
00042     */
00043     int select_input_main(Gamepad &pad, N5110 &lcd);
00044 
00045     /** displays continue menu screen and takes in input to select next state
00046     *@param Gamepad class for working with the gamepad
00047     *@param N5110 class which controlls lcd screen
00048     *@returns _input (1 when pressed, else 0) (int)
00049     */
00050     int select_input_continue(Gamepad &pad, N5110 &lcd);
00051 
00052     /** displays highscore screen
00053     *@param N5110 class which controlls lcd screen
00054     *@param highest level reached by user (int)
00055     */
00056     void print_highscore(N5110 &lcd, int highscore);
00057 
00058     /** displays continue menu screen and takes in input to select next state
00059     *@param Gamepad class for working with the gamepad
00060     *@param N5110 class which controlls lcd screen
00061     *@returns contrast level (float)
00062     */
00063     float print_settings(Gamepad &pad, N5110 &lcd);
00064 private:
00065 
00066     void print_main_menu(N5110 &lcd);                               //prints menu class visuals
00067     void print_continue_menu(N5110 &lcd);                           //prints continue class visuals
00068 
00069     void menu_decoration(N5110 &lcd);                               //prints menu border decoration
00070 
00071     void intro_b(N5110 &lcd, Gamepad &pad);                         //display b with note
00072     void intro_bl(N5110 &lcd, Gamepad &pad);                        //display bl with note
00073     void intro_blo(N5110 &lcd, Gamepad &pad);                       //display blo with note
00074     void intro_bloc(N5110 &lcd, Gamepad &pad);                      //display bloc with note
00075     void intro_block(N5110 &lcd, Gamepad &pad);                     //display block  with note
00076     void intro_block_h(N5110 &lcd, Gamepad &pad);                   //display block h with note
00077     void intro_block_he(N5110 &lcd, Gamepad &pad);                  //display block he with note
00078     void intro_block_hea(N5110 &lcd, Gamepad &pad);                 //display block hea with note
00079     void intro_block_head(N5110 &lcd, Gamepad &pad);                //display block head with note
00080 
00081     void B(int x, int y, N5110 &lcd);                               //prints B HEAD sprite
00082     void BL(int x, int y, N5110 &lcd);                              //prints BL sprite
00083     void BLO(int x, int y, N5110 &lcd);                             //prints BLO sprite
00084     void BLOC(int x, int y, N5110 &lcd);                            //prints BLOC sprite
00085     void BLOCK(int x, int y, N5110 &lcd);                           //prints BLOCK  sprite
00086     void BLOCK_H(int x, int y, N5110 &lcd);                         //prints BLOCK H sprite
00087     void BLOCK_HE(int x, int y, N5110 &lcd);                        //prints BLOCK HE sprite
00088     void BLOCK_HEA(int x, int y, N5110 &lcd);                       //prints BLOCK HEA sprite
00089     void BLOCK_HEAD(int x, int y, N5110 &lcd);                      //prints BLOCK HEAD sprite
00090 
00091     int _start;
00092     int _count;
00093 
00094     int _select;
00095     int _input;
00096     int _stop;
00097     bool _flash;
00098 
00099 };
00100 
00101 #endif