a little bit of cleanup, still some edge cases but took care of the big stuff

This commit is contained in:
2026-06-09 03:29:59 -04:00
parent 7a10f4a9fc
commit e209861cb3
2 changed files with 13 additions and 16 deletions
+7 -5
View File
@@ -47,6 +47,11 @@ public partial class EnemyController : TurnController
}
// public List<Vector2I> GetEnemyPath(Enemy ENEMY, Vector2I PATH)
// {
// }
public Vector2I GetBestGoal(Enemy ENEMY, Vector2I GOAL)
{
Vector2I goal = GOAL;
@@ -96,6 +101,7 @@ public partial class EnemyController : TurnController
{
Enemy enemy = _enemies[i];
enemy._speedRemaining = enemy._address.Y <= _playArea._map._minY ? 0 : enemy._speed;
if (enemy._speedRemaining > 0)
{
Vector2I goal = GetBestGoal(enemy, new(enemy._address.X, Math.Max(enemy._address.Y - enemy._visibilityRange, _playArea._map._minY)));
@@ -127,10 +133,6 @@ public partial class EnemyController : TurnController
List<Vector2I> path = _playArea._map.GetPath(enemy._address, goal);
Vector2I cell = path[0];
if (enemy._track)
{
GD.Print(cell, _playArea._map._astar.IsPointSolid(cell));
}
_playArea._map.SetCellEnemy(cell, enemy);
enemy._path.Add(cell);
enemy._speedRemaining--;
@@ -189,7 +191,7 @@ public partial class EnemyController : TurnController
public void SetEnemy(Enemy ENEMY, Vector2I CELL)
{
if (CELL == new Vector2I(8, 13))
if (CELL == new Vector2I(5, 7))
{
ENEMY._track = true;
}