Set game over for character condition

This commit is contained in:
2023-09-03 15:41:39 -07:00
parent f7417d0afd
commit 23f20f08e0
5 changed files with 35 additions and 16 deletions

View File

@@ -82,8 +82,19 @@ public partial class Player1 : Character
CanShoot = true;
}
private void HitDebug()
{
var node = new Node3D();
OnHit(node);
}
private void OnHit(Node3D node)
{
QueueFree();
_gameManager.RemoveP1Character();
if (_gameManager._p1Characters.Count == 0)
{
GD.Print("Game over for P1");
_gameManager.P1GameOver = true;
}
}
}