Package model.entities
Class ZenChanModel
java.lang.Object
model.entities.EntityModel
model.entities.EnemyModel
model.entities.ZenChanModel
ZenChanModel class is responsible for the ZenChan enemy logic
-
Field Summary
Fields inherited from class model.entities.EnemyModel
active, alive, enemyState, enemyType, fallSpeed, flySpeed, goDown, goUp, isFalling, isJumping, playerTileX, playerTileY, previousWalkingDir, reachedSpawn, spawnY, startWalkingDir, updatePlayerPosMaxInterval, walkingDir, walkSpeed, xSpeed, ySpeedFields inherited from class model.entities.EntityModel
height, hitbox, immune, levelManagerModel, timer, width, x, y -
Constructor Summary
ConstructorsConstructorDescriptionZenChanModel(float x, float y, Constants.Direction startWalkingDir) Constructs a new ZenChanModel with the specified position and starting direction. -
Method Summary
Modifier and TypeMethodDescriptionvoidbubbleCapture(Constants.Direction direction) Captures the ZenChan enemy in a bubble.Returns the type of the enemy.voidResets the state of the ZenChan enemy to his default state.voidupdate(PlayerModel playerModel) Updates the state of the ZenChan logic and behavior.Methods inherited from class model.entities.EnemyModel
calculatePlayersPos, canFall, changeWalkingDir, flipW, flipX, getEnemyState, getReachedSpawn, instantKill, isActive, isAlive, isPlayerInViewingRange, isPlayerLeftOrRight, isPlayerUpOrDown, setActive, setAlive, setEnemyState, updateSpawning, updateStateVariables, updateWalkingDirMethods inherited from class model.entities.EntityModel
conpenetrationSafeUpdateXPos, deactivate, getHitbox, getTileX, getTileY, initHitbox, initLevelManager, isImmune, updateXPos
-
Constructor Details
-
ZenChanModel
Constructs a new ZenChanModel with the specified position and starting direction.- Parameters:
x- x-coordinatey- y-coordinatestartWalkingDir- starting walking direction
-
-
Method Details
-
update
Updates the state of the ZenChan logic and behavior.- Specified by:
updatein classEnemyModel- Parameters:
playerModel- the player model used to update the ZenChan's behavior
-
resetEnemy
public void resetEnemy()Resets the state of the ZenChan enemy to his default state.- Overrides:
resetEnemyin classEnemyModel
-
bubbleCapture
Captures the ZenChan enemy in a bubble.This method is called when the ZenChan enemy is captured in a bubble. It resets various state variables of the ZenChan enemy, including flags for falling, jumping, and flying.
It also calls the superclass's bubbleCapture method, that created a
EnemyBubbleModelobject with inside the ZenChan enemy.- Overrides:
bubbleCapturein classEnemyModel- Parameters:
direction- the direction in which the bubble is moving
-
getEnemyType
Returns the type of the enemy.This method overrides the getEnemyType method from the superclass to return the specific type of the enemy, which is ZEN_CHAN.
- Specified by:
getEnemyTypein classEnemyModel- Returns:
- the type of the enemy
-