Win and loose conditions

This commit is contained in:
Rendo 2025-07-20 04:23:22 +05:00
commit b551c7f012
15 changed files with 193 additions and 122 deletions

View file

@ -11,12 +11,12 @@ public partial class DegradingSprite : Sprite2D
public override void _Ready()
{
armor.ArmorDamaged += OnZombieHPChanged;
armor.ArmorDamaged += OnArmorHPChanged;
}
private void OnZombieHPChanged(float hp)
private void OnArmorHPChanged(float hp)
{
float percent = hp / armor.MaxHP;
float percent = armor._hp / armor.MaxHP;
for (int i = 0; i < degradationStages.Count; i++)
{
if (percent <= thresholdPercentage[i])