Remade spawn coordinates system

This commit is contained in:
Marco 2025-01-27 17:13:26 +01:00
commit d633618633
5 changed files with 85 additions and 12 deletions

View file

@ -20,6 +20,8 @@ public partial class GameManager : Node2D
public InventoryManager Inventory => _inventoryManager;
private Node2D _bulletsContainer;
public Node2D BulletsContainer => _bulletsContainer;
// Called when the node enters the scene tree for the first time.
public override void _Ready()
@ -29,6 +31,8 @@ public partial class GameManager : Node2D
_inventoryManager = GetNode<InventoryManager>("InventoryManager");
SpawnBulletsContainer();
if (PlayerSpawnMarker != null)
{
SpawnPlayer();
@ -57,4 +61,12 @@ public partial class GameManager : Node2D
_cameraTarget.GlobalPosition = _player.Position;
}
}
private void SpawnBulletsContainer()
{
_bulletsContainer = new Node2D();
_bulletsContainer.Name = "BulletsContainer";
AddChild(_bulletsContainer);
}
}