Win and loose conditions
This commit is contained in:
parent
6c42479d6b
commit
48cdc6db05
15 changed files with 191 additions and 120 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