A complex 2D-dungeon game on LPC1768 in SWJTU-Leeds Joint School XJEL2645 project. Referenced from the framework contributed by https://os.mbed.com/users/Siriagus/code/SimplePlatformGame/

Dependencies:   mbed N5110 ShiftReg PinDetect

MainMenu.h

Committer:
Siriagus
Date:
2015-05-08
Revision:
10:f2488a0ecab7
Parent:
7:678873947b29
Child:
12:8178fad5e660

File content as of revision 10:f2488a0ecab7:

#ifndef MAIN_MENU_H
#define MAIN_MENU_H

#include "State.h"

/// State: Main Menu
class MainMenu : public State
{
    public:
        /// Creates a new MainMenu object
        MainMenu(StateManager* fsm, N5110 *lcd, InputManager* input)
                : State(fsm, lcd, input) {init();}
                
        virtual void update(float dt); /// Update logic
        virtual void render();         /// Draw MainMenu to screen
    
    private:
        void init();
        static void btnAPress(); /// Interrupt callback function when button A is pressed
        static void btnBPress(); /// Interrupt callback function when button B is pressed
        static void btnCPress(); /// Interrupt callback function when button C is pressed
        
    // Variables
    private:
        /// States for the main menu's internal finite state machine
        enum MenuState {SELECT_PLAY, SELECT_HIGHSCORES, SELECT_CONTROLS, LOAD_GAME, HIGHSCORES, CONTROLS};
        static int currentState; /// Current state of the internal finite state machine
        
        /** Transition table for internal fsm
        * Each row corresponds to a state
        * Each column corresponds to the button pressed
        */
        static const int MENU_FSM[6][3];
};

#endif