Class ZenChanModel


public class ZenChanModel extends EnemyModel
ZenChanModel class is responsible for the ZenChan enemy logic
  • Constructor Details

    • ZenChanModel

      public ZenChanModel(float x, float y, Constants.Direction startWalkingDir)
      Constructs a new ZenChanModel with the specified position and starting direction.
      Parameters:
      x - x-coordinate
      y - y-coordinate
      startWalkingDir - starting walking direction
  • Method Details

    • update

      public void update(PlayerModel playerModel)
      Updates the state of the ZenChan logic and behavior.
      Specified by:
      update in class EnemyModel
      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:
      resetEnemy in class EnemyModel
    • bubbleCapture

      public void bubbleCapture(Constants.Direction direction)
      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 EnemyBubbleModel object with inside the ZenChan enemy.

      Overrides:
      bubbleCapture in class EnemyModel
      Parameters:
      direction - the direction in which the bubble is moving
    • getEnemyType

      public Constants.EnemyConstants.EnemyType 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:
      getEnemyType in class EnemyModel
      Returns:
      the type of the enemy