Package view.itemsAndRewards
Class PowerUpView
java.lang.Object
view.itemsAndRewards.ItemView
view.itemsAndRewards.PowerUpView
The PowerUpView class represents the view for the
PowerUpModel class.
It handles drawing the power-up item and playing audio effects when the item is collected.-
Field Summary
Fields inherited from class view.itemsAndRewards.ItemView
animationIndex, animationTick, itemManagerView, itemModel, soundPlayed -
Constructor Summary
ConstructorsConstructorDescriptionPowerUpView(ItemModel itemModel) Constructs a PowerUpView with the specified ItemModel. -
Method Summary
Modifier and TypeMethodDescriptionvoidPlays the audio effects for the power-up item when it is collected.voidDraws the power-up item on the screen.Methods inherited from class view.itemsAndRewards.ItemView
getItemModel, isActive, update, updateAnimationTick
-
Constructor Details
-
PowerUpView
Constructs a PowerUpView with the specified ItemModel.- Parameters:
itemModel- the model of the power-up item
-
-
Method Details
-
draw
Draws the power-up item on the screen. If the item is de-spawning, it draws the de-spawning animation. -
audioEffects
public void audioEffects()Plays the audio effects for the power-up item when it is collected. Ensures the sound is played only once.- Specified by:
audioEffectsin classItemView
-