Class PlayerAnimationController
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.player.PlayerAnimationController
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidstarts the player's crouching animationvoidstarts the player's dash animationvoidstarts the player's death animationvoidstarts the player's hurt animationvoidstarts the player's jump animationvoidstarts the smoke animationvoidstop the player's current animation and return to idlevoidanimateWalk(com.badlogic.gdx.math.Vector2 direction) starts the player's walk animationvoidcreate()Called when the entity is created and registered.voidsetAnimation: to avoid repeated startup of the same animationsvoidsetAnimation(String animationName) setAnimation: to avoid repeated startup of the same animationsvoidsetAnimator(AnimationRenderComponent animator) voidvoidsetXDirection(int i) Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Field Details
-
scheduleTask
-
currentAnimation
-
-
Constructor Details
-
PlayerAnimationController
-
-
Method Details
-
create
public void create()Description copied from class:ComponentCalled 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. -
setAnimator
-
setTimer
-
animateStop
public void animateStop()stop the player's current animation and return to idle -
animateJump
public void animateJump()starts the player's jump animation -
animateWalk
public void animateWalk(com.badlogic.gdx.math.Vector2 direction) starts the player's walk animation -
animateCrouching
public void animateCrouching()starts the player's crouching animation -
revertAnimation
public void revertAnimation()setAnimation: to avoid repeated startup of the same animations -
setAnimation
setAnimation: to avoid repeated startup of the same animations -
animateDash
public void animateDash()starts the player's dash animation -
animateHurt
public void animateHurt()starts the player's hurt animation -
animateDeath
public void animateDeath()starts the player's death animation -
animateSmoke
public void animateSmoke()starts the smoke animation -
setXDirection
public void setXDirection(int i)
-