mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 02:35:54 +00:00
Dropping and picking up
This commit is contained in:
parent
488d02ef81
commit
bcd007fa1e
14 changed files with 294 additions and 62 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue