Delay start for animation

This commit is contained in:
Marco 2025-03-03 10:58:20 +01:00
commit a9a7b234fb
9 changed files with 108 additions and 23 deletions

View file

@ -30,6 +30,8 @@ public partial class Active : PlayerFSMState
[Export] private PlayerDamageReceiver _damageReceiver;
[Export] private ActivationProvider _activationProvider;
[Export] private InteractionController _interactionController;
private bool _isStrafing;
public int MovementSpeed => _isStrafing ? StrafeSpeed : Speed;
@ -51,16 +53,16 @@ public partial class Active : PlayerFSMState
ChangeState(PlayerState.Dead);
};
_damageReceiver.HealthChanged += (value, maxValue) =>
_damageReceiver.HealthDecreased += (value, newValue, maxValue) =>
{
_animationProvider.Blink();
_hud.UpdateHealth(value, maxValue);
//_hud.UpdateHealth(value, maxValue);
};
_damageReceiver.ShieldChanged += (value, maxValue) =>
_damageReceiver.ShieldDecreased += (value, newValue, maxValue) =>
{
_animationProvider.PlayShieldAnimation();
_hud.UpdateShield(value, maxValue);
//_hud.UpdateShield(value, maxValue);
};
_damageReceiver.Init();
@ -84,6 +86,7 @@ public partial class Active : PlayerFSMState
_animationProvider.ShowSprite();
_damageReceiver.Enabled = true;
_activationProvider.Enabled = true;
_interactionController.Enabled = true;
}
public override void ExitState()
@ -94,6 +97,7 @@ public partial class Active : PlayerFSMState
_damageReceiver.Enabled = false;
_activationProvider.Enabled = false;
_interactionController.Enabled = false;
}
public override void PhysicsProcessState(double delta)