Class PirateGame

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

    public class PirateGame
    extends com.badlogic.gdx.Game
    Contains class instances of game UI screens.
    • Constructor Summary

      Constructors 
      Constructor Description
      PirateGame()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void create()
      Create instances of game stage and UI screens.
      void dispose()
      Clean up prevent memory leeks
      void LoadGame()
      New for assessment 2 Loads the game from the saved data
      static void loadResources()
      Added for Assessment 2 Modularized resource loading, so it can be called from tests and for code clarity
      void restartGame()
      New for assessment 2 Restarts the game by reinitialising the Managers and creating a new instance of GameScreen
      void setDifficulty​(java.lang.String selected)
      New for assessment 2 Changes the difficulty for the game by changing the enum and calling GameManager.getSettings()
      void setScreen​(com.badlogic.gdx.Screen screen)
      New for assessment 2 new version of setScreen to stop the game screen being deleted before a new screen is set if the new screen is pause.
      void StartGame()
      Added for assessment 2 so that the game doesn't start until after the difficulty has been chosen by the player
      • Methods inherited from class com.badlogic.gdx.Game

        getScreen, pause, render, resize, resume
      • Methods inherited from class java.lang.Object

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

      • stage

        public com.badlogic.gdx.scenes.scene2d.Stage stage
      • skin

        public com.badlogic.gdx.scenes.scene2d.ui.Skin skin
      • id_map

        public static int id_map
    • Constructor Detail

      • PirateGame

        public PirateGame()
    • Method Detail

      • create

        public void create()
        Create instances of game stage and UI screens.
      • loadResources

        public static void loadResources()
        Added for Assessment 2 Modularized resource loading, so it can be called from tests and for code clarity
      • dispose

        public void dispose()
        Clean up prevent memory leeks
        Specified by:
        dispose in interface com.badlogic.gdx.ApplicationListener
        Overrides:
        dispose in class com.badlogic.gdx.Game
      • setScreen

        public void setScreen​(com.badlogic.gdx.Screen screen)
        New for assessment 2 new version of setScreen to stop the game screen being deleted before a new screen is set if the new screen is pause.
        Overrides:
        setScreen in class com.badlogic.gdx.Game
        Parameters:
        screen - the screen to be changed to
      • restartGame

        public void restartGame()
        New for assessment 2 Restarts the game by reinitialising the Managers and creating a new instance of GameScreen
      • setDifficulty

        public void setDifficulty​(java.lang.String selected)
        New for assessment 2 Changes the difficulty for the game by changing the enum and calling GameManager.getSettings()
      • StartGame

        public void StartGame()
        Added for assessment 2 so that the game doesn't start until after the difficulty has been chosen by the player
      • LoadGame

        public void LoadGame()
        New for assessment 2 Loads the game from the saved data