basic enemy movement

This commit is contained in:
reisenlol 2026-01-04 22:28:34 -08:00
parent 46d2b7bc95
commit fd8778e9f2
No known key found for this signature in database
6 changed files with 377 additions and 15 deletions

View file

@ -11,11 +11,14 @@ public class Enemy : Entity
turnSpeed = Random.Range(0, 100);
}
[ContextMenu("ForceTurn")]
public void StartTurn()
{
//attack the nearest player?
TurnHandler.instance.UpdateTurns();
closestPlayer = FindClosestPlayer();
Debug.Log(closestPlayer);
EnemyMovement.instance.PathfindToTarget(closestPlayer.currentTile.neighbors[Random.Range(0, closestPlayer.currentTile.neighbors.Count)], this);
}
private PlayerEntity FindClosestPlayer()