The players pickup radius should be a upgrade of its own. But currently the pickup radius is directly tied to the xp orb. How can we change this so the players pickup radius factors into this?
// XPOrb.cs
public partial class XPOrb : AnimatedSprite2D
{
public event Action<Player> OnPickup;
public int Value { get; set; }
public override void _Ready()
{
GetNode<Area2D>("Area2D").BodyEntered += body =>
{
if (body is Player player)
{
OnPickup?.Invoke(player);
// Destroy this xp orb
QueueFree();
}
};
}
}
The players pickup radius should be a upgrade of its own. But currently the pickup radius is directly tied to the xp orb. How can we change this so the players pickup radius factors into this?