mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:35:34 +00:00
Explosions for bullets
This commit is contained in:
parent
8e784be1aa
commit
8ab4546579
9 changed files with 58 additions and 11 deletions
24
Scripts/Weapons/AutoclearingBulletEmitter.cs
Normal file
24
Scripts/Weapons/AutoclearingBulletEmitter.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using Cirno.Scripts.Activables;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Weapons;
|
||||
|
||||
public partial class AutoclearingBulletEmitter : BulletEmitter
|
||||
{
|
||||
[Export]
|
||||
public float Timeout { get; private set; } = 5f;
|
||||
|
||||
private double _timeoutTimer = 0f;
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
base._Process(delta);
|
||||
if (!IsEmitting) return;
|
||||
_timeoutTimer += delta;
|
||||
|
||||
if (_timeoutTimer >= Timeout)
|
||||
{
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
}
|
||||
1
Scripts/Weapons/AutoclearingBulletEmitter.cs.uid
Normal file
1
Scripts/Weapons/AutoclearingBulletEmitter.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://df81kn4u8yigu
|
||||
Loading…
Add table
Add a link
Reference in a new issue