Package model.itemesAndRewards
Class ItemManagerModel
java.lang.Object
model.itemesAndRewards.ItemManagerModel
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 Summary
Modifier and TypeMethodDescriptionvoidaddBubbleReward(int x, int y, Constants.Items.BubbleRewardType type) Adds a bubble reward item at the specified position.static ItemManagerModelReturns the singleton instance of the ItemManagerModel.Returns the list of item models managed by this class.voidResets the state of the item manager for a new level.voidResets the state of the item manager for a new play session.voidupdate()Updates the state of the items and checks for power-up spawns.
-
Method Details
-
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
Adds a bubble reward item at the specified position.- Parameters:
x- the x-coordinate of the rewardy- the y-coordinate of the rewardtype- 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
Returns the list of item models managed by this class.- Returns:
- the list of item models
-