Package view.entities

Class EnemyView

java.lang.Object
view.entities.EnemyView
Direct Known Subclasses:
SkelMonstaView

public class EnemyView extends Object
The EnemyView class represents the view for an EnemyModel. It handles updating the enemy's animation and state variables.
  • Field Details

    • enemyModel

      protected final EnemyModel enemyModel
    • animationIndex

      protected int animationIndex
    • animationTick

      protected int animationTick
    • animationAction

      protected int animationAction
    • animationSpeedMultiplier

      protected float animationSpeedMultiplier
  • Constructor Details

    • EnemyView

      public EnemyView(EnemyModel enemyModel)
      Constructs an EnemyView with the specified EnemyModel.
      Parameters:
      enemyModel - the model for the enemy entity
  • Method Details

    • update

      public void update()
      Updates the enemy's animation and state variables.
    • updateAnimationTick

      protected void updateAnimationTick()
      Updates the animation tick and index based on the animation speed multiplier.
    • updateStateVariables

      protected void updateStateVariables()
      Updates the state variables for the enemy based on its current state.
    • isActive

      public boolean isActive()
      Checks if the enemy is active.
      Returns:
      true if the enemy is active, false otherwise
    • getAnimationIndex

      public int getAnimationIndex()
      Returns the current animation index.
      Returns:
      the current animation index