Class CombatAnimationDisplay

All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, Renderable, Comparable<Renderable>

public class CombatAnimationDisplay extends UIComponent
CombatAnimationDisplay represents the UI displayed during combat, such as attack animations.
  • Constructor Details

    • CombatAnimationDisplay

      public CombatAnimationDisplay()
      Constructor for the CombatAnimationDisplay.
  • Method Details

    • getRockTravelTime

      public static float getRockTravelTime()
      Getter method for rock travel time for audio purposes
    • getBothAttackAnimationDelay

      public static float getBothAttackAnimationDelay()
      Getter method for delay between animations for audio purposes
    • create

      public void create()
      Description copied from class: Component
      Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished.
      Overrides:
      create in class UIComponent
    • animateCombat

      public void animateCombat(CombatManager.Action playerAction, CombatManager.Action enemyAction, Boolean playerFaster)
      Resolves how to animation combat based on player and enemy action and which one is faster
    • initiatePlayerAnimation

      public void initiatePlayerAnimation(CombatManager.Action animationType)
      Initialise the intended animation passed as an animationType from the combat manager class based on chosen / randomised player or enemy attack
    • initiateEnemyAnimation

      public void initiateEnemyAnimation(CombatManager.Action animationType)
      Initialise the intended animation passed as an animationType from the combat manager class based on chosen / randomised player or enemy attack
    • sleepAnimation

      public void sleepAnimation()
      Triggers general sleep animation when sleeping action chosen by player
    • enemySleepAnimation

      public void enemySleepAnimation()
      Triggers identical sleep animation for enemy
    • guardAnimation

      public void guardAnimation()
      Triggers generalised guard animation when guard button pressed for all players/
    • enemyGuardAnimation

      public void enemyGuardAnimation()
      Triggers generalised guard animation when guard button pressed for all players/
    • playerAttackAnimation

      public void playerAttackAnimation()
      Triggers fireball to be thrown at enemy entity's position
    • enemyAttackAnimation

      public void enemyAttackAnimation()
      Generates fireball animation from enemy entity position to player position
    • draw

      public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Description copied from class: RenderComponent
      Draw the renderable. Should be called only by the renderer, not manually.
      Specified by:
      draw in class RenderComponent
      Parameters:
      batch - Batch to render to.
    • update

      public void update()
      Description copied from class: Component
      Called once per frame of the game, and should be used for most component logic. Not called if component is disabled.
      Overrides:
      update in class Component
    • dispose

      public void dispose()
      Description copied from class: Component
      Called when the component is disposed. Dispose of any internal resources here.
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent