com.badlogic.gdx.ai.fsm.DefaultStateMachine Java Examples

The following examples show how to use com.badlogic.gdx.ai.fsm.DefaultStateMachine. 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: BrainComponent.java    From xibalba with MIT License 5 votes vote down vote up
/**
 * The brain.
 *
 * @param entity What entity has this brain
 */
public BrainComponent(Entity entity) {
  stateMachine = new DefaultStateMachine<>(entity, Brain.SLEEP);

  dna = new Array<>();

  fear = 0f;
}
 
Example #2
Source File: HumanCharacter.java    From GdxDemo3D with Apache License 2.0 5 votes vote down vote up
public HumanCharacter(Model model,
					  String name,
					  Vector3 location,
					  Vector3 rotation,
					  Vector3 scale,
					  btCollisionShape shape,
					  float mass,
					  short belongsToFlag,
					  short collidesWithFlag,
					  boolean callback,
					  boolean noDeactivate,
					  Array<BlenderEmpty> ragdollEmpties,
					  String armatureNodeId) {

	super(model, name, location, rotation, scale,
			shape, mass, belongsToFlag, collidesWithFlag,
			callback, noDeactivate, ragdollEmpties, armatureNodeId,
			new HumanSteerSettings());

	// Create path follower
	followPathSteerer = new FollowPathSteerer(this);

	// Create the animation controllers
	animations = new AnimationController(modelInstance);
	// Create animation listeners for states that need one
	stateAnimationListeners = new EnumMap<HumanState, AnimationListener>(HumanState.class);
	stateAnimationListeners.put(HumanState.THROW, new AnimationListener());

	// Create the state machine
	stateMachine = new DefaultStateMachine<HumanCharacter, HumanState>(this);
	// Set the steering variables associated with default move state (walking)
	stateMachine.changeState(moveState);
	// Then make the character idle
	stateMachine.changeState(moveState.idleState);
}
 
Example #3
Source File: Entity.java    From ninja-rabbit with GNU General Public License v2.0 5 votes vote down vote up
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 #4
Source File: Bob.java    From gdx-ai with Apache License 2.0 5 votes vote down vote up
public Bob (Elsa elsa) {
	this.elsa = elsa;
	location = Location.SHACK;
	goldCarried = 0;
	moneyInBank = 0;
	thirst = 0;
	fatigue = 0;

	stateMachine = new DefaultStateMachine<Bob, BobState>(this, BobState.GO_HOME_AND_SLEEP_TILL_RESTED);
}
 
Example #5
Source File: GhostAgent.java    From Pacman_libGdx with MIT License 4 votes vote down vote up
public GhostAgent(GhostComponent ghostComponent) {
    this.ghostComponent = ghostComponent;
    stateMachine = new DefaultStateMachine<>(this);

    timer = 0;
}
 
Example #6
Source File: PlayerAgent.java    From Pacman_libGdx with MIT License 4 votes vote down vote up
public PlayerAgent(PlayerComponent playerComponent) {
    this.playerComponent = playerComponent;
    stateMachine = new DefaultStateMachine<>(this);
    timer = 0;
}
 
Example #7
Source File: QuillRat.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public QuillRat(int entityId) {
  super(entityId);
  stateMachine = new DefaultStateMachine<>(entityId, State.IDLE);
}
 
Example #8
Source File: Fallen.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public Fallen(int entityId) {
  super(entityId);
  stateMachine = new DefaultStateMachine<>(entityId, State.IDLE);
}
 
Example #9
Source File: Zombie.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public Zombie(int entityId) {
  super(entityId);
  stateMachine = new DefaultStateMachine<>(entityId, State.IDLE);
}
 
Example #10
Source File: Elsa.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
public Elsa (Bob bob) {
	stateMachine = new DefaultStateMachine<Elsa, ElsaState>(this, ElsaState.DO_HOUSE_WORK, ElsaState.GLOBAL_STATE);
	this.bob = bob;
}