This commit is contained in:
2026-06-09 19:12:40 -04:00
parent 4722cf882b
commit 9a0a33b82c
3 changed files with 10 additions and 7 deletions
+3 -3
View File
@@ -88,9 +88,9 @@ public partial class EnemyController : TurnController
public void HandleEnemyClick(Enemy ENEMY)
{
GD.Print(ENEMY._address, _playArea._map._astar.IsPointSolid(ENEMY._address));
if (ENEMY._speedRemaining <= 0){
return;
}
// if (ENEMY._speedRemaining <= 0){
// return;
// }
TileMapLayer pathLayer = _playArea.GetNode<TileMapLayer>("PathLayer");
Vector2I goal = GetBestGoal(ENEMY, new(ENEMY._address.X, Math.Max(ENEMY._address.Y - ENEMY._visibilityRange, _playArea._map._minY)));
if (ENEMY._address == Vector2I.Zero)
+5 -4
View File
@@ -109,6 +109,7 @@ public partial class Map : TileMapLayer
public void SetupAstar()
{
_astar.Region = new Rect2I(_minX, _minY, _topRow.Count, _leftmostColumn.Count);
// GD.Print(_astar.Region);
_astar.CellSize = _cellSize;
_astar.DefaultComputeHeuristic = AStarGrid2D.Heuristic.Manhattan;
_astar.DiagonalMode = AStarGrid2D.DiagonalModeEnum.Never;
@@ -121,21 +122,21 @@ public partial class Map : TileMapLayer
_astar.SetPointSolid(FROM, false);
if (FROM == Vector2I.Zero)
{
GD.Print(4,_astar.IsPointSolid(FROM));
// GD.Print(4,_astar.IsPointSolid(FROM));
}
if (TO == Vector2I.Zero)
{
GD.Print(5,_astar.IsPointSolid(FROM));
// GD.Print(5,_astar.IsPointSolid(FROM));
}
List<Vector2I> pathTaken = [.. _astar.GetIdPath(FROM, TO, true)];
_astar.SetPointSolid(FROM, true);
if (FROM == Vector2I.Zero)
{
GD.Print(6,_astar.IsPointSolid(FROM));
// GD.Print(6,_astar.IsPointSolid(FROM));
}
if (TO == Vector2I.Zero)
{
GD.Print(7,_astar.IsPointSolid(FROM));
// GD.Print(7,_astar.IsPointSolid(FROM));
}
if (!INCLUDE_FROM)
+2
View File
@@ -22,6 +22,8 @@ public partial class PlayArea : Node2D
CollisionShape2D regionBounds = _region.GetNode<CollisionShape2D>("Bounds");
_map = GetNode<Map>("Map");
TileMapLayer occupiedSpaces = GetNode<TileMapLayer>("OccupiedSpaces");
occupiedSpaces.SetCell(Vector2I.Zero, 0, new Vector2I(4,0));
}
public override void _Process(double delta)