Class MenuTwinkleBubble

java.lang.Object
model.entities.EntityModel
view.overlays.menuOverlays.MenuTwinkleBubble

public class MenuTwinkleBubble extends EntityModel
The MenuTwinkleBubble class represents a twinkling bubble in the menu.

Many twinkling bubbles are used as a background effect in the menus.

Thi class handles the animation and movement of the bubble.

  • Constructor Details

    • MenuTwinkleBubble

      public MenuTwinkleBubble(BufferedImage[] sprite, int startX, int startY, MenuTwinkleBubbleManager manager)
      Constructs a MenuTwinkleBubble with the specified sprite, starting position, and manager. Randomizes the initial animation index and direction.
      Parameters:
      sprite - the array of images for the bubble animation
      startX - the starting x-coordinate of the bubble
      startY - the starting y-coordinate of the bubble
      manager - the manager that handles the bubble
  • Method Details

    • update

      public void update()
      Updates the bubble's animation and position.
    • draw

      public void draw(Graphics2D g)
      Draws the bubble on the screen at its current position and animation frame.
      Parameters:
      g - the Graphics2D object to draw with