Package com.csse3200.game.overlays
Class CombatAnimationDisplay
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.ui.UIComponent
com.csse3200.game.overlays.CombatAnimationDisplay
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
CombatAnimationDisplay represents the UI displayed during combat, such as attack animations.
-
Field Summary
Fields inherited from class com.csse3200.game.ui.UIComponent
skin, stage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
animateCombat
(CombatManager.Action playerAction, CombatManager.Action enemyAction, Boolean playerFaster) Resolves how to animation combat based on player and enemy action and which one is fastervoid
create()
Called when the entity is created and registered.void
dispose()
Called when the component is disposed.void
draw
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draw the renderable.void
Generates fireball animation from enemy entity position to player positionvoid
Triggers generalised guard animation when guard button pressed for all players/void
Triggers identical sleep animation for enemystatic float
Getter method for delay between animations for audio purposesstatic float
Getter method for rock travel time for audio purposesvoid
Triggers generalised guard animation when guard button pressed for all players/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 attackvoid
initiatePlayerAnimation
(CombatManager.Action animationType) Initialise the intended animation passed as an animationType from the combat manager class based on chosen / randomised player or enemy attackvoid
Triggers fireball to be thrown at enemy entity's positionvoid
Triggers general sleep animation when sleeping action chosen by playervoid
update()
Called once per frame of the game, and should be used for most component logic.Methods inherited from class com.csse3200.game.ui.UIComponent
getLayer, getZIndex, setStage
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, render
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.csse3200.game.rendering.Renderable
render
-
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 classUIComponent
-
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
Initialise the intended animation passed as an animationType from the combat manager class based on chosen / randomised player or enemy attack -
initiateEnemyAnimation
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 classRenderComponent
- 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. -
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 interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classRenderComponent
-