Class Game


  • public class Game
    extends Object
    Class that manage the whole game
    Author:
    Darius Dinger
    • Constructor Detail

      • Game

        public Game()
    • Method Detail

      • init

        public static void init​(int windowWidth,
                                int windowHeight,
                                String windowTitle,
                                Window.Type windowType,
                                TextureData windowIcon)
        Initializing the game and all relevant libraries
        Parameters:
        windowWidth - Initial width of the game window
        windowHeight - Initial height of the game window
        windowTitle - Initial title of the game window
        windowType - Initial window type
        windowIcon - Icon of the window, or null for no icon
      • registerScene

        public static int registerScene​(Scene scene)
        Register scene in the game
        Parameters:
        scene - Scene to register
        Returns:
        Id of the scene
      • removeScene

        public static void removeScene​(int id)
      • getCurrentScene

        public static Scene getCurrentScene()
        Returns:
        Current scene or null if no scene set
      • gotoScene

        public static void gotoScene​(int id)
        Going to specific scene
        Parameters:
        id - Id of the scene to enter
      • tick

        public static void tick()
        Updating inputs handlers, window and executing master renderers render call to render all stuff
      • setPaused

        public static void setPaused​(boolean paused)
        Set the game in paused state or the other way round.
        Parameters:
        paused - Should game be paused
      • isPaused

        public static boolean isPaused()
        Returns:
        Is the game currently paused.
      • exit

        public static void exit​(int code)
        Exiting the game and dumping all reserved memory
        Parameters:
        code - Exit code (0 == Success, else Errror)