repeater and compound projectile
This commit is contained in:
parent
e316fa3203
commit
3d9f0f7423
9 changed files with 235 additions and 42 deletions
22
scripts/projectiles/CompoundProjectile.cs
Normal file
22
scripts/projectiles/CompoundProjectile.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using Godot;
|
||||
|
||||
public partial class CompoundProjectile : Node2D
|
||||
{
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
{
|
||||
GetTree().ProcessFrame += ReleaseCompound;
|
||||
}
|
||||
|
||||
public void ReleaseCompound()
|
||||
{
|
||||
GetTree().ProcessFrame -= ReleaseCompound;
|
||||
|
||||
foreach (var child in GetChildren())
|
||||
{
|
||||
child.Reparent(GetParent());
|
||||
}
|
||||
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
1
scripts/projectiles/CompoundProjectile.cs.uid
Normal file
1
scripts/projectiles/CompoundProjectile.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://j6nq8w2n8532
|
||||
Loading…
Add table
Add a link
Reference in a new issue