Class ItemManagerModel

java.lang.Object
model.itemesAndRewards.ItemManagerModel

public class ItemManagerModel extends Object
Manages the items and rewards in the game.

This class is responsible for handling the spawning, updating, and collision detection of items and rewards in the game.

  • Method Details

    • getInstance

      public static ItemManagerModel getInstance()
      Returns the singleton instance of the ItemManagerModel.
      Returns:
      the singleton instance
    • update

      public void update()
      Updates the state of the items and checks for power-up spawns.
    • addBubbleReward

      public void addBubbleReward(int x, int y, Constants.Items.BubbleRewardType type)
      Adds a bubble reward item at the specified position.
      Parameters:
      x - the x-coordinate of the reward
      y - the y-coordinate of the reward
      type - the type of bubble reward
    • newLevelReset

      public void newLevelReset()
      Resets the state of the item manager for a new level.
    • newPlayReset

      public void newPlayReset()
      Resets the state of the item manager for a new play session.
    • getItemsModels

      public ArrayList<ItemModel> getItemsModels()
      Returns the list of item models managed by this class.
      Returns:
      the list of item models