projectile lifetime
parent
2fdc9beca0
commit
4a34595a97
|
@ -17,8 +17,19 @@ namespace SupaLidlGame.Entities
|
||||||
[Export]
|
[Export]
|
||||||
public Hitbox Hitbox { get; set; }
|
public Hitbox Hitbox { get; set; }
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public double Lifetime { get; set; } = 10;
|
||||||
|
|
||||||
public Character Character { get; set; }
|
public Character Character { get; set; }
|
||||||
|
|
||||||
|
public override void _Process(double delta)
|
||||||
|
{
|
||||||
|
if ((Lifetime -= delta) <= 0)
|
||||||
|
{
|
||||||
|
QueueFree();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void _PhysicsProcess(double delta)
|
public override void _PhysicsProcess(double delta)
|
||||||
{
|
{
|
||||||
Vector2 velocity = Velocity;
|
Vector2 velocity = Velocity;
|
||||||
|
|
Loading…
Reference in New Issue