Skip to content
Raghuram Iyer "Ragzzy-R" edited this page May 19, 2014 · 3 revisions

The post assumes you have the basic knowledge of using libgdx,java and eclipse

Setting up in eclipse

To use these classes, right now I haven't made any jars. So you need to download the source and use it directly.I'll soon make the jars.

State Machines

Before going into how to use these classes I'll explain what are state machines with respect to Animations. If you are aware of what it is, then skip this part. For a broader detail on the whole mathematical model of Finite State Machines, see here.

Let us assume there is an Anmation. Say we have a character which can walk,jump,stay idle and shoot. Now assume initially our guy is in idle state. Say when user presses arrow keys, the player walks. So "FSM"ically speaking he has had a transition from "Idle" state to "Walk" state. Now when user presses spacebar, he jumps, so now he has transitioned from his previous state to "Jump" state. So what exactly happening is the character is transitioning between one of N FINITE STATES, throughout its lifetime.

![FSM](http://jakkarrlgames.com/images/FSM - New Page (1).jpeg)

Basic idea

Now let's dive into Animation Manager. Strictly speaking, It should not be called an Animation Manager because its not a complete subsystem. But I hope one day it will become one, and since it helps MANAGE states of ANIMATION, I just named it that. So forget about the name for the time being.

The structure of Animation Manager is like this. Each of the above States are represented by the class Animator. So in the above example we have 4 Animators for each walk,jump,stay and shoot.

Now since All these states belong to one single character which may be a hero or an NPC, say jim, jim is an AnimatableEntity. We attach all the animators to this class. Let's see how to this is done.

Clone this wiki locally