Particles system

This commit is contained in:
Rendo 2025-06-28 02:44:42 +05:00
commit 0e5dee50f7
46 changed files with 643 additions and 200 deletions

View file

@ -1,4 +1,5 @@
using Godot;
using Newlon.Components.Level;
using Newlon.Systems.Effects;
namespace Newlon.Components;
@ -17,6 +18,8 @@ public partial class LinearProjectile : Area2D, IProjectile
private Effect _impactEffect;
[Export]
private Utility.DamageTypes _damageType = Utility.DamageTypes.PHYSICAL;
[Export]
private PackedScene particles;
private int _line;
private bool used = false;
public int Line { get => _line; set { _line = value; } }
@ -37,6 +40,9 @@ public partial class LinearProjectile : Area2D, IProjectile
used = true;
if (entity is IEffectHandler effectHandler && _impactEffect != null)
effectHandler.GiveEffect(_impactEffect);
PoolContainer.Instance.SpawnParticles(particles, GlobalPosition);
QueueFree();
}
}