working some more on enemy movement, they stilldon't always want to move to the sides when they reach the front so still some more work to do. also updated the aiming a bit to clamp the arc for firing and drawing, rewrote the draw arc function
This commit is contained in:
@@ -17,11 +17,12 @@ public partial class Map : TileMapLayer
|
||||
{
|
||||
base._Ready();
|
||||
_cellSize = TileSet.TileSize;
|
||||
List<Vector2I> cells = GetUsedCells().ToList();
|
||||
List<Vector2I> cells = [.. GetUsedCells()];
|
||||
_minX = cells.Min(c => c.X);
|
||||
_maxX = cells.Max(c => c.X);
|
||||
_minY = cells.Min(c => c.Y);
|
||||
_maxY = cells.Max(c => c.Y);
|
||||
// GD.Print(_minX, _maxX, _minY, _maxY);
|
||||
_leftmostColumn = [.. cells.Where(c => c.X == _minX)];
|
||||
_rightmostColumn = [.. cells.Where(c => c.X == _maxX)];
|
||||
_topRow = [.. cells.Where(c => c.Y == _minY)];
|
||||
@@ -51,6 +52,14 @@ public partial class Map : TileMapLayer
|
||||
return hasOccupant || isSolid;
|
||||
}
|
||||
|
||||
public bool IsRowFull(int ROW_TO_CHECK)
|
||||
{
|
||||
List<Vector2I> cells = [.. GetUsedCells()];
|
||||
List<Vector2I> rowCells = [.. cells.Where(c => c.Y == ROW_TO_CHECK)];
|
||||
|
||||
return rowCells.All(c => GetOccupant(c) != null);
|
||||
}
|
||||
|
||||
public void SetCellEnemy(Vector2I ADDRESS, Enemy ENEMY)
|
||||
{
|
||||
_addressOccupants[ADDRESS] = ENEMY;
|
||||
@@ -89,4 +98,9 @@ public partial class Map : TileMapLayer
|
||||
return pathTaken;
|
||||
}
|
||||
|
||||
public void EvaluateSolidCells()
|
||||
{
|
||||
GetUsedCells().ToList().ForEach(c => IsCellSolid(c));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user