Class PowerUpManagerModel

java.lang.Object
model.itemesAndRewards.PowerUpManagerModel

public class PowerUpManagerModel extends Object
Manages the power-ups in the game.

The PowerUpManagerModel class is responsible for handling the activation and effects of power-ups collected by the player. It tracks various power-up states and counters, applies power-up effects to the player, and determines which power-up to spawn based on game events.

  • Method Details

    • getInstance

      public static PowerUpManagerModel getInstance()
    • update

      public void update()
      Updates the state of the power-ups and applies their effects to the player.
    • applyPowerUp

      public void applyPowerUp()
      Applies the effects of the active power-ups to the player.
    • getPowerUpToSpawn

      public Constants.Items.PowerUpType getPowerUpToSpawn()
      Determines which power-up to spawn based on game events and counters.
      Returns:
      the type of power-up to spawn, or null if no power-up should be spawned
    • newPlayReset

      public void newPlayReset()
      Resets the state of the power-up manager for a new play session.
    • reset

      public void reset()
      Resets all power-up states and counters.
    • increaseBubbleShootCounter

      public void increaseBubbleShootCounter()
      Increases the bubble shoot counter.
    • increaseBubblePopCounter

      public void increaseBubblePopCounter()
      Increases the bubble pop counter.
    • increaseJumpCounter

      public void increaseJumpCounter()
      Increases the jump counter.
    • addDistance

      public void addDistance(float distance)
      Adds the specified distance to the walked distance counter.
      Parameters:
      distance - the distance to add
    • increaseWaterBubblePopCounter

      public void increaseWaterBubblePopCounter()
      Increases the water bubble pop counter.
    • increaseItemCollectCounter

      public void increaseItemCollectCounter()
      Increases the item collect counter.
    • collectedGreenCandy

      public void collectedGreenCandy()
      Marks the green candy as collected and resets the bubble shoot counter.
    • collectedBlueCandy

      public void collectedBlueCandy()
      Marks the blue candy as collected and resets the bubble pop counter.
    • collectedRedCandyCounter

      public void collectedRedCandyCounter()
      Marks the red candy as collected and resets the jump counter.
    • collectedShoe

      public void collectedShoe()
      Marks the shoe as collected and resets the walked distance counter.
    • collectedOrangeParasol

      public void collectedOrangeParasol()
      Marks the orange parasol as collected and resets the water bubble pop counter.
    • collectedBlueParasol

      public void collectedBlueParasol()
      Marks the blue parasol as collected and resets the water bubble pop counter.
    • collectedChacknHeart

      public void collectedChacknHeart()
      Marks the Chack'n Heart as collected and resets the item collect counter.
    • collectedCrystalRing

      public void collectedCrystalRing()
      Marks the crystal ring as collected and resets the blue candy counter.
    • collectedEmeraldRing

      public void collectedEmeraldRing()
      Marks the emerald ring as collected and resets the green candy counter.
    • collectedRubyRing

      public void collectedRubyRing()
      Marks the ruby ring as collected and resets the red candy counter.