Class AchievementService

java.lang.Object
com.csse3200.game.achievements.AchievementService

public class AchievementService extends Object
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.

  • Method Details

    • get

      public static AchievementService get()
    • addListener

      public void addListener(AchievementService.Listener l)
    • removeListener

      public void removeListener(AchievementService.Listener l)
    • isUnlocked

      public boolean isUnlocked(AchievementId id)
    • 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)