Class LevelManager

java.lang.Object
tech.underoaks.coldcase.game.LevelManager

public class LevelManager extends Object
Manages the levels in the game. This class is responsible for loading levels, tracking the current level, and transitioning between levels.
  • Field Details

    • currentLevelIndex

      public int currentLevelIndex
      The index showing which level is currently being played.
  • Method Details

    • getInstance

      public static LevelManager getInstance()
      Returns the singleton instance of LevelManager. If the instance doesn't exist, it creates a new one.
      Returns:
      The singleton instance of LevelManager.
    • loadNextLevel

      public void loadNextLevel()
      Loads the next level based on the current level index. If the current level is the last one, it resets to the first level and sets the next stage to the main menu.
    • loadLevel

      public void loadLevel(Levels level)
      Loads the specified level and sets the next stage to the game stage for the given level.
      Parameters:
      level - The level to be loaded.