Class: Animation

Properties

frames {Array.<Object>}

This is an array of objects that look like: { hitbox: Hitbox, translation: Point }. Each element of the array is one frame of the animation. If translation is set then this animation has a specific path it will follow, see AnimationTrajectory for more information.

loop {boolean}

This is true if the animation loops over from the beginning when it's done. Examples of looping animations are "idle", "walk", "hyakuRetsuKyakuSlow" (Chun Li's one-hundred leg kick), etc.

waits {boolean}

This is true if the animation will wait on the final frame for some condition. Examples of waiting animations are "crouch", "guard", and "jump". If an animation has neither loop nor waits then it should automatically change to some other animation when it's done.

staticHitbox {boolean}

Some animations use the same hitbox for every frame of the animation. Examples include "idle", "walk", "guard", and "crouch".

minDistance {number}

Some attacks can only be performed at a certain distance from the opponent. Distance is calculated by:

distance = Math.abs(player.position.x - opponent.position.x) - player.distanceOffset - opponent.distanceOffset;
maxDistance {number}

Maximum distance at which this attack can be performed.

throwBox {Rect}

If this animation is a throw attack then this is the area of the grab. If a player's throwBox (specified here) intersects with the opponent's throwableBox (specified on Character) and the opponent is in a throwable state (not specified anywhere, sorry) then the throw will connect.