still working out movement

This commit is contained in:
2026-07-04 03:04:56 -04:00
parent 336b72e4cb
commit dbafefd660
16 changed files with 136 additions and 71 deletions
+1 -2
View File
@@ -14,11 +14,10 @@ public partial class Spearman : FriendlyPeg
public override MapCell Goal()
{
Map map = _pegController._playArea._map;
Dictionary<Vector2I, MapCell> enemies = GetVisibleEnemies();
if (enemies.Count == 0)
{
return _map._cells[_address];
return _cell;
}
Dictionary<Vector2I, MapCell> closest = enemies.OrderBy(e => (e.Value._occupant._address - _address).Length()).ToDictionary();
return closest.ElementAt(0).Value;