Game Development Reference
In-Depth Information
setAnimation(Animation.Idle);
}
}
7. Finally, to test the concept of
AnimChannels
, we can implement
Ac-
tionListener
in our
SimpleApplication
instance and bind some keys
to it, as shown in the following code:
public void onAction(String name, boolean isPressed,
float tpf) {
if (name.equals("Anim1") && isPressed) {
jaime.getControl(AnimationChannelsControl.class)
.setAnimation(Animation.Walk, Channel.All);
}
...
}
8. As an example of how the concept of
AnimChannels
can be used to create new
animations out of combined ones, create a new application and set the walk anim-
ation on Jaime's
lowerChannel
while applying the jumping animation on
up-
perChannel
. Jaime will now commence a zombie walk impression.