Win and loose conditions
This commit is contained in:
parent
804122a3bd
commit
b551c7f012
15 changed files with 193 additions and 122 deletions
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue