Class LightningBubbleModel


public class LightningBubbleModel extends SpecialBubbleModel
Represents a lightning bubble generated by the BubbleGenerator.

This class extends the SpecialBubbleModel and provides specific behavior for lightning bubbles. When popped by the player, it spawns a LightingProjectileModel

  • Constructor Details

    • LightningBubbleModel

      public LightningBubbleModel(float x, float y, Constants.Direction direction)
      Constructs a new LightningBubbleModel.
      Parameters:
      x - the starting x coordinate
      y - the starting y coordinate
      direction - the starting direction
  • Method Details

    • update

      public void update()
      Updates the state and position of the lightning bubble.

      This method updates the timers, direction, position, collision boxes, and applies the Pac-Man effect.

      Specified by:
      update in class SpecialBubbleModel
    • playerPop

      public void playerPop(PlayerModel playerModel)
      Handles the player popping the lightning bubble.

      This method deactivates the bubble and spawns a lightning projectile at the bubble's position.

      Specified by:
      playerPop in class SpecialBubbleModel
      Parameters:
      playerModel - the player model