death and restart menu working
This commit is contained in:
@@ -38,6 +38,9 @@ public partial class PlayerController : CharacterBody3D,
|
||||
///////////////////////////
|
||||
// Signals and events //
|
||||
///////////////////////////
|
||||
|
||||
[Signal]
|
||||
public delegate void PlayerDiedEventHandler();
|
||||
|
||||
public event Action<IDamageable, DamageRecord> DamageTaken;
|
||||
public event Action<IHealthable, HealthChangedRecord> HealthChanged;
|
||||
@@ -593,6 +596,9 @@ public partial class PlayerController : CharacterBody3D,
|
||||
// Attack states
|
||||
_attackStandard.StateEntered += OnStandardAttackStarted;
|
||||
_attackDash.StateEntered += OnDashAttackStarted;
|
||||
|
||||
// Testing out kill
|
||||
// GetTree().CreateTimer(2).Timeout += () => Kill(this);
|
||||
}
|
||||
|
||||
///////////////////////////
|
||||
@@ -2168,7 +2174,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
|
||||
public void Kill(IHealthable source)
|
||||
{
|
||||
GD.Print("Player died!");
|
||||
EmitSignalPlayerDied();
|
||||
}
|
||||
|
||||
public void ResetInvincibility()
|
||||
|
||||
Reference in New Issue
Block a user