Dropping and picking up

This commit is contained in:
Marco 2025-03-28 19:47:10 +01:00
commit bcd007fa1e
14 changed files with 294 additions and 62 deletions

View file

@ -15,6 +15,8 @@ public partial class ItemDrop : RigidBody2D
PackedScene dropScene = GD.Load<PackedScene>(ItemToDrop.DropScenePath);
Node dropInstance = dropScene.Instantiate();
AddChild(dropInstance);
dropInstance.Owner = this;
float angle = _rng.RandfRange(0, Mathf.Tau); // 0 to 2π
Vector2 direction = new Vector2(Mathf.Cos(angle), Mathf.Sin(angle)).Normalized();