Game Development Reference
In-Depth Information
How to do it...
We can have different animations playing on different parts of the body at the same time by
performing the following steps:
1. First of all, we'll implement the
ActionListener
and
AnalogListener
in-
terfaces in our animation's
manager
class. This will allow us to receive input dir-
ectly from an input-handling class and decide which animations to play.
2. Next, we define two
AnimChannels
: one for the upper body called
upper-
Channel
and one for the lower called
lowerChannel
. We also create a
Chan-
nel
enum to easily choose whether to play an animation in a separate channel or
the whole body, as shown in the following code:
public enum Channel{
Upper, Lower, All,
}
◦ The SceneExplorer can be used to find suitable bones as shown in the fol-
lowing screenshot: