mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-07 21:25:53 +00:00
Automatic tile avoidance
This commit is contained in:
parent
a01ed821b7
commit
a861c331da
6 changed files with 94 additions and 20 deletions
|
|
@ -45,6 +45,9 @@ public partial class GameManager : Node2D
|
|||
[Export]
|
||||
public StringName PauseActionName { get; private set; } = "pause";
|
||||
|
||||
[Export]
|
||||
public TilemapAvoidance NavigationTilemap { get; private set; }
|
||||
|
||||
private Node2D _bulletsContainer;
|
||||
public Node2D BulletsContainer => _bulletsContainer;
|
||||
|
||||
|
|
@ -354,6 +357,16 @@ public partial class GameManager : Node2D
|
|||
node.QueueFree();
|
||||
}
|
||||
}
|
||||
|
||||
public void RecalculateTilemap(Vector2 position)
|
||||
{
|
||||
CallDeferred(MethodName.RecalculateTilemapDeferred, position);
|
||||
}
|
||||
|
||||
private void RecalculateTilemapDeferred(Vector2 position)
|
||||
{
|
||||
NavigationTilemap.Recalculate(position);
|
||||
}
|
||||
}
|
||||
|
||||
public enum GameState
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue