com.badlogic.gdx.ai.fsm.State Java Examples
The following examples show how to use
com.badlogic.gdx.ai.fsm.State.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Entity.java From ninja-rabbit with GNU General Public License v2.0 | 5 votes |
public Entity(final GraphicsProcessor graphics, final PhysicsProcessor physics, final AudioProcessor audio, final State<Entity> initialState) { this.graphics = graphics; this.physics = physics; this.audio = audio; stateMachine = new DefaultStateMachine<Entity>(this, initialState); }
Example #2
Source File: Entity.java From ninja-rabbit with GNU General Public License v2.0 | 2 votes |
/** * Sets a new {@link State} for this {@link Entity} to be performed in the next execution step * for this character. * * @see StateMachine#changeState(State) * * @param newState * The state to make the transition to. Each {@link Entity} may define its own. * */ public void changeState(final State<Entity> newState) { stateMachine.changeState(newState); }
Example #3
Source File: Entity.java From ninja-rabbit with GNU General Public License v2.0 | 2 votes |
/** * Whether this entity is performing the given state or not. * * @see StateMachine#isInState(State) * @param state * The state to test against the current actions of the entity. * @return true if this entity is executing the state; false, otherwise. */ public boolean isInState(final State<Entity> state) { return state != null && stateMachine.isInState(state); }
Example #4
Source File: Entity.java From ninja-rabbit with GNU General Public License v2.0 | 2 votes |
/** * Returns the current state of this {@link Entity}. * * @see StateMachine#getCurrentState() * @return The {@link State} this entity is currently in. */ public State<Entity> getCurrentState() { return stateMachine.getCurrentState(); }