Package com.csse3200.game.achievements
Class AchievementService
java.lang.Object
com.csse3200.game.achievements.AchievementService
Minimal achievements service for:
- ADRENALINE_RUSH: sprint for 30 seconds (per-level accumulation)
- STAMINA_MASTER: finish a level without ever hitting 0 stamina
- LEVEL_1_COMPLETE
- LEVEL_2_COMPLETE
Persists unlocks and sprint time using LibGDX Preferences.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceConsumers (e.g., toast UI) can subscribe to be notified on unlocks. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddSprintTime(float dt) Call every frame while sprinting to accumulate time for Adrenaline Rush.voiddevReset()static AchievementServiceget()floatbooleanbooleanvoidMark that stamina hit zero sometime this level.voidonLevelCompleted(int levelNumber) Call when the level is completed.voidCall when the level begins (resets per-level flags, keeps lifetime sprintSeconds).voidvoidupdate(float dt)
-
Method Details
-
get
-
addListener
-
removeListener
-
isUnlocked
-
getSprintSeconds
public float getSprintSeconds() -
getStaminaEverExhausted
public boolean getStaminaEverExhausted() -
onLevelStarted
public void onLevelStarted()Call when the level begins (resets per-level flags, keeps lifetime sprintSeconds). -
addSprintTime
public void addSprintTime(float dt) Call every frame while sprinting to accumulate time for Adrenaline Rush. -
markStaminaExhausted
public void markStaminaExhausted()Mark that stamina hit zero sometime this level. -
onLevelCompleted
public void onLevelCompleted(int levelNumber) Call when the level is completed. Also evaluates STAMINA_MASTER for this level. -
devReset
public void devReset() -
update
public void update(float dt)
-