mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-14 09:03:46 +00:00
Explosions for bullets
This commit is contained in:
parent
8e784be1aa
commit
8ab4546579
9 changed files with 58 additions and 11 deletions
|
|
@ -24,7 +24,7 @@ public partial class BulletEmitter : Node2D, IActivable
|
|||
|
||||
private BulletSpawner _bulletSpawner;
|
||||
|
||||
private bool _isEmitting = false;
|
||||
protected bool IsEmitting = false;
|
||||
|
||||
private double _emitTimer = 0f;
|
||||
|
||||
|
|
@ -33,13 +33,14 @@ public partial class BulletEmitter : Node2D, IActivable
|
|||
_bulletSpawner = GetNode<BulletSpawner>("BulletSpawner");
|
||||
if (EmitOnStart)
|
||||
{
|
||||
_isEmitting = true;
|
||||
IsEmitting = true;
|
||||
CallDeferred(MethodName.Shoot);
|
||||
}
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (!_isEmitting) return;
|
||||
if (!IsEmitting) return;
|
||||
_emitTimer += delta;
|
||||
|
||||
if (_emitTimer >= EmitCoolDown)
|
||||
|
|
@ -60,17 +61,17 @@ public partial class BulletEmitter : Node2D, IActivable
|
|||
{
|
||||
case ActivationType.Open:
|
||||
case ActivationType.Enable:
|
||||
_isEmitting = true;
|
||||
IsEmitting = true;
|
||||
_emitTimer = 0;
|
||||
break;
|
||||
case ActivationType.Close:
|
||||
case ActivationType.Disable:
|
||||
_isEmitting = false;
|
||||
IsEmitting = false;
|
||||
_emitTimer = 0;
|
||||
break;
|
||||
case ActivationType.Use:
|
||||
case ActivationType.Toggle:
|
||||
_isEmitting = !_isEmitting;
|
||||
IsEmitting = !IsEmitting;
|
||||
_emitTimer = 0;
|
||||
break;
|
||||
case ActivationType.Destroy:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue