Mobs Animation Controller - UQcsse3200/2023-studio-3 GitHub Wiki
Introduction
The Projectile Animation Controller is responsible for animating the phases of a projectile. This component is called in the 'TrajectTask' by calling START using trigger(). The animations are packed using GDXTexture Packer to create an atlas. A new class, 'ProjectileAnimationController' is made to start the picture called. Then, the animations are ran by the 'AnimationRenderComponent' through 'startAnimation' method.
The following UML diagram gives a hierarchical overview of how ProjectileAnimationController links with other components:
Initialiser: create()
This method configures the AnimationRenderComponent animator; variable to refer to the AnimationRenderComponent present in the same entity as this component, by running animator = this.entity.getComponent(AnimationRenderComponent.class);
It further proceeds to add listeners for the tower's animation triggers as follows:
entity.getEvents().addListener(START, this::animateStart);
entity.getEvents().addListener(FINAL, this::animateFinal);
Animators: animate[ANIMATION-NAME]()
The animator methods for this class are as follows:
void animateStart();
void animateFinal();