Example usage for com.badlogic.gdx.ai.steer.behaviors Flee Flee

List of usage examples for com.badlogic.gdx.ai.steer.behaviors Flee Flee

Introduction

In this page you can find the example usage for com.badlogic.gdx.ai.steer.behaviors Flee Flee.

Prototype

public Flee(Steerable<T> owner, Steerable<T> target) 

Source Link

Document

Creates a Flee behavior for the specified owner and target.

Usage

From source file:com.mygdx.entities.DynamicEntities.enemies.Enemy_TestMon.java

public Enemy_TestMon(Vector2 pos) {
    super(pos, 40f, 40f);

    idleTexture = MainGame.am.get(ResourceManager.ENEMY_PH);
    deadTexture = MainGame.am.get(ResourceManager.ENEMY_PH_DEAD);

    texture = idleTexture;//from  ww w.  j  ava2  s . c om

    //AI
    wanderSB = new Wander<Vector2>(this).setFaceEnabled(false).setAlignTolerance(0.001f)
            .setDecelerationRadius(5).setTimeToTarget(0.1f).setWanderOffset(90).setWanderOrientation(10)
            .setWanderRadius(40f).setWanderRate(MathUtils.PI2 * 4);

    seekWanderSB = new Seek<Vector2>(this, seekWanderTarget);
    fleeSB = new Flee<Vector2>(this, EnvironmentManager.player);

    this.maxLinearSpeed = 150f;
    this.maxLinearAcceleration = 500f;
    this.maxAngularSpeed = 30f;
    this.maxAngularAcceleration = 5f;
}