Package model.bubbles.playerBubbles
Class EmptyBubbleModel
java.lang.Object
model.entities.EntityModel
model.bubbles.BubbleModel
model.bubbles.playerBubbles.PlayerBubbleModel
model.bubbles.playerBubbles.EmptyBubbleModel
- Direct Known Subclasses:
EnemyBubbleModel
Represents an empty bubble created by the player.
This class extends the PlayerBubbleModel and provides specific behavior for empty bubbles. Empty bubbles do not have any special behavior when they are in the dead state.
-
Field Summary
Fields inherited from class model.bubbles.playerBubbles.PlayerBubbleModel
bubbleManagerFields inherited from class model.bubbles.BubbleModel
active, blinkingTimer, bubbleType, direction, externalCollisionBox, internalCollisionBox, levelManagerModel, normalTimer, popped, popTimer, previousDirection, previousState, redTimer, shake, shakeTimer, state, timer, xSpeed, ySpeed -
Constructor Summary
ConstructorsConstructorDescriptionEmptyBubbleModel(float x, float y, Constants.Direction direction) Constructs a new EmptyBubbleModel. -
Method Summary
Modifier and TypeMethodDescriptionvoidplayerPop(PlayerModel playerModel, int EnemyBubblePopCounter, ChainReactionManager chainReactionManager) Handles the player popping the bubble, this overloaded method is used only by theChainReactionManager.voidpop()Pops the bubble and updates its state.protected voidUpdates the bubble's movement after it has been popped by the player.Methods inherited from class model.bubbles.playerBubbles.PlayerBubbleModel
checkCollisionWithPlayer, update, updateTimersMethods inherited from class model.bubbles.BubbleModel
bounceDown, bubbleShaking, changeDirection, getBubbleType, getCenter, getDirection, getState, handlePlayerPush, initCollisionBoxes, isActive, isPlayerJumpingOnBubble, isPlayerPoppingBubble, isPlayerTouchingBubble, isPopped, pacManEffect, setActive, updateCollisionBoxes, updateDirection, updatePositionMethods inherited from class model.entities.EntityModel
conpenetrationSafeUpdateXPos, deactivate, getHitbox, getTileX, getTileY, initHitbox, initLevelManager, isImmune, updateXPos
-
Constructor Details
-
EmptyBubbleModel
Constructs a new EmptyBubbleModel.- Parameters:
x- the starting x coordinatey- the starting y coordinatedirection- the starting direction
-
-
Method Details
-
updateDeadAction
protected void updateDeadAction()Updates the bubble's movement after it has been popped by the player. Overrides the updateDeadAction method fromPlayerBubbleModel.Empty bubbles do not have any special behavior, so this method is empty.
- Specified by:
updateDeadActionin classPlayerBubbleModel
-
pop
public void pop()Pops the bubble and updates its state. Overrides the pop method fromPlayerBubbleModelto pop the empty bubble.Called when the bubble pops and is used to change the state of the bubble to the correct pop state based on the previous state before the bubble was popped.
- Specified by:
popin classPlayerBubbleModel
-
playerPop
public void playerPop(PlayerModel playerModel, int EnemyBubblePopCounter, ChainReactionManager chainReactionManager) Handles the player popping the bubble, this overloaded method is used only by theChainReactionManager. Overrides the playerPop method fromPlayerBubbleModelto handle the player popping the bubble.Called when the player pops the bubble, and is used to change the state of the bubble to the correct pop state based on the previous state before the bubble was popped.
In this case when and empty bubble is popped, it will just simply pop using the
pop()method.- Specified by:
playerPopin classPlayerBubbleModel- Parameters:
playerModel- the player modelEnemyBubblePopCounter- the number of enemy bubbles poppedchainReactionManager- the chain explosion manager
-