Class BubbleRewardView

java.lang.Object
view.itemsAndRewards.ItemView
view.itemsAndRewards.BubbleRewardView

public class BubbleRewardView extends ItemView
The BubbleRewardView class represents the view for the BubbleRewardModel. It handles drawing the bubble reward item and playing audio effects when the item is collected.
  • Constructor Details

    • BubbleRewardView

      public BubbleRewardView(ItemModel itemModel)
      Constructs a BubbleRewardView with the specified ItemModel.
      Parameters:
      itemModel - the model of the bubble reward item
  • Method Details

    • draw

      public void draw(Graphics g)
      Draws the bubble reward item on the screen. If the item is de-spawning, it draws the de-spawning animation.
      Specified by:
      draw in class ItemView
      Parameters:
      g - the Graphics object to draw with
    • audioEffects

      public void audioEffects()
      Plays the audio effects for the bubble reward item when it is collected. Ensures the sound is played only once.
      Specified by:
      audioEffects in class ItemView