Game Development Reference
In-Depth Information
Handling jump animations
In this recipe, we'll show how the jumping animation can be handled in the animation man-
ager control from previous recipes. Why does this require its own recipe? Animation-wise,
jumping is usually a set of sequenced animations. If we look at Jaime, for example, there's
JumpStart
,
Jumping
, and
JumpEnd
. Normally, sequenced animations can be handled
in the
onAnimCycleDone
method; when one animation ends, it can trigger the next.
Jumping is different though since the middle jumping animation is indefinite and is on a
loop. How long it plays depends on how long the character is in the air, which is driven by
the gameplay or its physics.