June 2013
Beginner
352 pages
9h 5m
English
Everything is set up, but if you run the application now, the model is stuck in its idle pose. Use what you learned in the previous chapter about the AnalogListener and ActionListener, and configure the Space bar to make the character walk toward you gradually, while playing the walk animation!
ActionListener that waits for the MAPPING_WALK trigger, and then tests whether the key is pressed or up. If the key is pressed, test if ANI_WALK is still playing on the animation channel; if it isn't, play ANI_WALK again. If the key is not pressed, play ANI_IDLE again.private ActionListener actionListener = new ActionListener() { public void onAction(String name, boolean isPressed, float tpf) { if (name.equals(MAPPING_WALK) ...Read now
Unlock full access