MenuManager

Description

MenuManager will handle all menus that are accessed throughout the game. Each menu will be a MenuScreen with a MenuItem for each menu option. For each MenuItem, it will lead to a specific MenuScreen, and if it does not, the MenuManager will hold the specific execution. During the initialization of the MenuManager, it will also create every MenuItem that is required and then add the corresponding MenuItem to the correct MenuScreen.

Relationships

Members

  • MenuScreen[] menuArray - A data structure that contains all the possible menus
  • List<string> nameList - List of all the MenuScreen names
  • int currentMenu - An integer that represents the current index of menuArray
  • MenuItem selected - The current MenuItem that is selected
  • List<MenuItem> itemList - The list of the MenuItem for the current active MenuScreen
  • MenuScreen[] prevScreen - An array of previous MenuScreen used for backtracking

menuArray will contain, but is not limited to :

  • MenuScreen InGamePause - Accessed when the player pauses the game in the gamestate
  • MenuScreen ApplicationMenu - Accessed when the application loads (Start Menu)
  • MenuScreen LoadMenu - Accessed when the player wishes to load a game during. Accessed from the Application Menu
  • MenuScreen OptionMenu - Accessed when the player chooses option on the Pause menu or Application menu
  • MenuScreen GameOver - Accessed when the player has died
  • MenuScreen Loading - Accessed during any loading period
  • MenuScreen Audio - Accessed when the player wishes to change the audio settings
  • MenuScreen Video - Accessed when the player wishes to change the video settings
  • MenuScreen Controls - Accessed when the player wishes to see the current control scheme

Methods

  • CycleUp
    • Will call the current MenuScreen to cycle up to the previous option
  • CycleDown
    • Will call the current MenuScreen to cycle up to the next option
  • ActivateMenu
    • Will change the index of the currentMenu to select the correct menu
  • SliderAdd
    • Adds to the value the slider is associated with due to user input
  • SliderSub
    • Subtracts to the value the slider is associated with due to user input
  • Draw
    • Will call the current MenuScreen to draw it to the screen
  • Update
    • Will update the current menuscreen and handle any other updates that are needed
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License