NPCs now spawn facing a random direction and with slightly varying speed

This commit is contained in:
kuroppoi 2022-08-21 22:12:14 +02:00
parent af915279a8
commit 581a3c0742

View file

@ -114,8 +114,9 @@ public class Npc extends Entity {
this.weaknesses = config.getWeaknesses();
this.animations = config.getAnimations();
this.behaviorTree = SequenceBehavior.createBehaviorTree(this, behavior);
this.direction = Math.random() < 0.5 ? FacingDirection.WEST : FacingDirection.EAST;
health = maxHealth;
speed = baseSpeed;
speed = baseSpeed * (float)(0.9 + Math.random() * 0.2);
}
@Override