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
+18 -17
View File
@@ -20,8 +20,7 @@ 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));
TileMapLayer occupiedSpaces = GetNode<TileMapLayer>("OccupiedSpaces");
}
public override void _Process(double delta)
@@ -32,21 +31,23 @@ public partial class PlayArea : Node2D
public void HighlightCells()
{
TileMapLayer occupiedSpaces = GetNode<TileMapLayer>("OccupiedSpaces");
// _map._cells.ForEach(c =>
// {
// if (_map.HasOccupant(c))
// {
// occupiedSpaces.SetCell(c, 0, new Vector2I(4,0));
// }
// else if (_map._astar.IsPointSolid(c))
// {
// }
// else
// {
// occupiedSpaces.SetCell(c, 0, Vector2I.Down*4);
// }
// });
for (int i = 0; i < _map._cells.Count; i++)
{
MapCell c = _map._cells.ElementAt(i).Value;
if (c._occupant != null)
{
GD.Print(c._occupant);
occupiedSpaces.SetCell(c._address, 0, new Vector2I(4,0));
}
else if (_map._astar.IsPointSolid(c._address))
{
occupiedSpaces.SetCell(c._address, 0, new Vector2I(3,1));
}
else
{
occupiedSpaces.SetCell(c._address, 0, new Vector2I(4,1));
}
}
}
}