diff --git a/Entities/Projectile.cs b/Entities/Projectile.cs index 7996bc1..8e157c8 100644 --- a/Entities/Projectile.cs +++ b/Entities/Projectile.cs @@ -17,8 +17,19 @@ namespace SupaLidlGame.Entities [Export] public Hitbox Hitbox { get; set; } + [Export] + public double Lifetime { get; set; } = 10; + public Character Character { get; set; } + public override void _Process(double delta) + { + if ((Lifetime -= delta) <= 0) + { + QueueFree(); + } + } + public override void _PhysicsProcess(double delta) { Vector2 velocity = Velocity;