Patterns tweaks

This commit is contained in:
Marco 2025-02-13 11:59:51 +01:00
commit a430554e27
7 changed files with 69 additions and 22 deletions

View file

@ -112,11 +112,26 @@ public partial class GameManager : Node2D
_player.GlobalPosition = PlayerSpawnMarker.Position;
if (_cameraTarget != null)
{
_cameraTarget.Reparent(_player, true);
_cameraTarget.GlobalPosition = _player.Position;
}
CameraTargetPlayer();
//
// if (_cameraTarget != null)
// {
// _cameraTarget.Reparent(_player, true);
// _cameraTarget.GlobalPosition = _player.Position;
// }
}
public void CameraTargetPlayer()
{
if (_player is null) return;
CameraTargetObject(_player);
}
public void CameraTargetObject(Node2D target)
{
if (_cameraTarget is null) return;
_cameraTarget.Reparent(target, true);
_cameraTarget.GlobalPosition = target.GlobalPosition;
}
private void SpawnWeapons()