diff --git a/EnemyController.cs b/EnemyController.cs index 4f47a89..35b05f1 100644 --- a/EnemyController.cs +++ b/EnemyController.cs @@ -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("PathLayer"); Vector2I goal = GetBestGoal(ENEMY, new(ENEMY._address.X, Math.Max(ENEMY._address.Y - ENEMY._visibilityRange, _playArea._map._minY))); if (ENEMY._address == Vector2I.Zero) diff --git a/Map.cs b/Map.cs index 737f5e1..f31ed11 100644 --- a/Map.cs +++ b/Map.cs @@ -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 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) diff --git a/PlayArea.cs b/PlayArea.cs index 7c84184..461ad63 100644 --- a/PlayArea.cs +++ b/PlayArea.cs @@ -22,6 +22,8 @@ public partial class PlayArea : Node2D CollisionShape2D regionBounds = _region.GetNode("Bounds"); _map = GetNode("Map"); + TileMapLayer occupiedSpaces = GetNode("OccupiedSpaces"); + occupiedSpaces.SetCell(Vector2I.Zero, 0, new Vector2I(4,0)); } public override void _Process(double delta)