Class MenuScreen

  • All Implemented Interfaces:
    com.badlogic.gdx.Screen

    public class MenuScreen
    extends java.lang.Object
    implements com.badlogic.gdx.Screen
    Main Menu screen
    Author:
    Michele Imbriani
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MenuScreen.MenuScreenState
      Used to define the current state of the screen, MAINMENU is used mostly but then TRUCKSELECT used when the "NewGame" button has been pressed
    • Constructor Summary

      Constructors 
      Constructor Description
      MenuScreen​(Kroy game)  
    • Method Summary

      Modifier and Type Method Description
      void clickCheck()
      Checks if any of the buttons have been pressed and the number of the fireTruck type is passed to the new GameScreen
      void dispose()  
      void hide()  
      void pause()  
      void render​(float delta)
      Enum allows to make the MenuScreen behave differently depending on whether it's in mainMenu, Options or fireTruckSelection
      void resize​(int width, int height)  
      void resume()  
      void setCurrentlyRunningGame​(boolean state)  
      void setGameState​(MenuScreen.MenuScreenState state)  
      void show()  
      void startGame​(int truckNum)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • music

        public static com.badlogic.gdx.audio.Music music
      • musicVolume

        public static float musicVolume
    • Constructor Detail

      • MenuScreen

        public MenuScreen​(Kroy game)
        Parameters:
        game -
    • Method Detail

      • show

        public void show()
        Specified by:
        show in interface com.badlogic.gdx.Screen
      • render

        public void render​(float delta)
        Enum allows to make the MenuScreen behave differently depending on whether it's in mainMenu, Options or fireTruckSelection
        Specified by:
        render in interface com.badlogic.gdx.Screen
      • clickCheck

        public void clickCheck()
        Checks if any of the buttons have been pressed and the number of the fireTruck type is passed to the new GameScreen
      • startGame

        public void startGame​(int truckNum)
        Parameters:
        truckNum - Type of truck selected
      • setCurrentlyRunningGame

        public void setCurrentlyRunningGame​(boolean state)
        Parameters:
        state -
      • resize

        public void resize​(int width,
                           int height)
        Specified by:
        resize in interface com.badlogic.gdx.Screen
      • pause

        public void pause()
        Specified by:
        pause in interface com.badlogic.gdx.Screen
      • resume

        public void resume()
        Specified by:
        resume in interface com.badlogic.gdx.Screen
      • hide

        public void hide()
        Specified by:
        hide in interface com.badlogic.gdx.Screen
      • dispose

        public void dispose()
        Specified by:
        dispose in interface com.badlogic.gdx.Screen