mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-21 20:18:14 +07:00
Added Idle AI (default AI)
Added Idle AI (default AI) -- does nothing Changed default angle for entities to align with correct default direction
This commit is contained in:
parent
f1fb2e69b2
commit
edc4166a8d
@ -3,6 +3,7 @@ package gdx.diablo.ai;
|
||||
import gdx.diablo.entity.Monster;
|
||||
|
||||
public abstract class AI {
|
||||
public static final AI IDLE = new Idle();
|
||||
|
||||
protected Monster entity;
|
||||
|
||||
|
10
core/src/gdx/diablo/ai/Idle.java
Normal file
10
core/src/gdx/diablo/ai/Idle.java
Normal file
@ -0,0 +1,10 @@
|
||||
package gdx.diablo.ai;
|
||||
|
||||
public class Idle extends AI {
|
||||
public Idle() {
|
||||
super(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(float delta) {}
|
||||
}
|
@ -127,7 +127,7 @@ public class Entity {
|
||||
String weaponClass;
|
||||
Vector3 position = new Vector3();
|
||||
Vector3 velocity = new Vector3();
|
||||
float angle = MathUtils.PI * 3 / 2;
|
||||
float angle = MathUtils.atan2(-1, -2);//MathUtils.PI * 3 / 2;
|
||||
|
||||
boolean running = false;
|
||||
float walkSpeed = 6;
|
||||
@ -529,4 +529,6 @@ public class Entity {
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void select(Player player) {}
|
||||
}
|
||||
|
@ -60,7 +60,9 @@ public class Monster extends Entity {
|
||||
//if (!object.Draw) return null; // TODO: Not yet
|
||||
|
||||
Monster monster = new Monster(map, obj, monstats);
|
||||
if (monstats.AI.equalsIgnoreCase("Npc")) {
|
||||
if (monstats.AI.equalsIgnoreCase("Idle")) {
|
||||
monster.ai = AI.IDLE;
|
||||
} else if (monstats.AI.equalsIgnoreCase("Npc")) {
|
||||
monster.ai = new Npc(monster);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user