Bullet freeze

This commit is contained in:
Marco 2025-04-26 11:24:20 +02:00
commit 34a07342ac
31 changed files with 255 additions and 8 deletions

View file

@ -30,6 +30,8 @@ public partial class Bullet : Area2D
public bool IsGrazed { get; set; } = false;
public bool IsFrozen { get; private set; } = false;
[Signal] public delegate void OnDestroyEventHandler();
private AudioStreamPlayer2D _grazeSound;
@ -182,8 +184,7 @@ public partial class Bullet : Area2D
{
ApplyTimeModifiers(delta);
}
if (BulletInfo.Controllabe)
{
ControlBullet(delta);
@ -273,6 +274,13 @@ public partial class Bullet : Area2D
EmitSignal(SignalName.OnDestroy);
QueueFree();
}
public void Freeze()
{
IsFrozen = true;
EmitSignal(SignalName.OnDestroy);
QueueFree();
}
}
public enum BulletOwner