Package tech.underoaks.coldcase.game
Class LevelManager
java.lang.Object
tech.underoaks.coldcase.game.LevelManager
Manages the levels in the game.
This class is responsible for loading levels, tracking the current level,
and transitioning between levels.
-
Field Summary
FieldsModifier and TypeFieldDescriptionintThe index showing which level is currently being played. -
Method Summary
Modifier and TypeMethodDescriptionstatic LevelManagerReturns the singleton instance of LevelManager.voidLoads the specified level and sets the next stage to the game stage for the given level.voidLoads the next level based on the current level index.
-
Field Details
-
currentLevelIndex
public int currentLevelIndexThe index showing which level is currently being played.
-
-
Method Details
-
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
Loads the specified level and sets the next stage to the game stage for the given level.- Parameters:
level- The level to be loaded.
-