Skip to content

XenoAnimationController

meganroxburgh edited this page Sep 11, 2023 · 9 revisions

Introduction

The XenoAnimationController has been modified to add listeners to the Xeno mob, handling the events wanderStart, runHurt, meleeStart, shootStart, dieStart and stop. While previously, each of these animation sets existed separately among different atlas files, changes have been made to combine them into a single atlas and PNG, making them easier to read from.

The animateRun() function is called when a wanderStart event occurs. This event is currently triggered by the WanderTask class and the MobAttackTask at instances where the entity is to either end their current task and continue to pace forward, or when the entity has no other task to perform. A check has been added to this function which ensures the shootStart event is not being performed in order for a call to trigger the wanderStart event to be successful

Xeno Grunt Assets

The Xeno Grunt is a basic enemy mobs which spawns in high volume down each lane, capable of shooting at the tower directly in front, or swinging at it once close enough. This is the first basic mob to be implemented, and as such has a basic but diverse ability set, which serves as the basis for future general mob implementations.

Run Animations

The Xeno Grunt run animations are simple 8 frame loops, read from the xeno-grunt-run.png and xeno-grunt-run-damaged.png by xenoGruntRunning.atlas and xenoGruntRunningDamaged.atlas respectively. xeno-grunt-run xeno-grunt-run-damaged

Attack Animations

Attack animations are read from the xeno-grunt-melee-attack.png and xeno-grunt-range-attack.png by xenoGruntRangedAttack.atlas and xenoGruntMeleeAttack.atlas respectively. These animations operate on different loop lengths, with the first melee attack having a 9 frame loop, the second melee attack having a 6 frame loop, and the ranged attack having a 5 frame loop. xeno-grunt-melee-attack xeno-grunt-range-attack

Death Animations

The death animation is read from xeno-grunt-death.png by xenoGruntDeath.atlas, and has a 5 frame loop. This sprite sheet has been made up from the separate PNGs xeno-grunt-death-falling.png and xeno-grunt-death-grounded.png. xeno-grunt-death

XenoAnimationController Class

The XenoAnimationController class listens for the events relating to the Xeno Grunts ability set, and has been set up to play the relevant animation once detected.

Testing

Clone this wiki locally