-
Notifications
You must be signed in to change notification settings - Fork 4
Mobs Animation Controller
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:
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);
The animator methods for this class are as follows:
void animateStart();
void animateFinal();