still some bug fixes to work out but not sure how to duplicate them? starting to work on enemy attacks
This commit is contained in:
@@ -91,13 +91,16 @@ public partial class Map : TileMapLayer
|
||||
|
||||
public void SetCellEnemy(Vector2I ADDRESS, Enemy ENEMY)
|
||||
{
|
||||
if (ENEMY._address != -Vector2I.One)
|
||||
if (ENEMY != null)
|
||||
{
|
||||
_addressOccupants[ENEMY._address] = null;
|
||||
SetCellSolid(ENEMY._address);
|
||||
if (ENEMY._address != -Vector2I.One)
|
||||
{
|
||||
_addressOccupants[ENEMY._address] = null;
|
||||
SetCellSolid(ENEMY._address);
|
||||
}
|
||||
ENEMY._address = ADDRESS;
|
||||
}
|
||||
|
||||
ENEMY._address = ADDRESS;
|
||||
|
||||
_addressOccupants[ADDRESS] = ENEMY;
|
||||
SetCellSolid(ADDRESS);
|
||||
@@ -112,11 +115,14 @@ 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;
|
||||
_astar.Update();
|
||||
// for (int i = 0; i < _cells.Count; i++)
|
||||
// {
|
||||
// _astar.SetPointWeightScale(_cells[i], _cells[i].Y * 5);
|
||||
// }
|
||||
EvaluateSolidCells();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user