projectile lifetime

pull/3/head
John Montagu, the 4th Earl of Sandvich 2023-06-03 14:02:40 -07:00
parent 2fdc9beca0
commit 4a34595a97
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
1 changed files with 11 additions and 0 deletions

View File

@ -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;