diff --git a/Assets/Enemies/Ennemy.cs b/Assets/Enemies/Ennemy.cs index 2130433..2d2ee0f 100644 --- a/Assets/Enemies/Ennemy.cs +++ b/Assets/Enemies/Ennemy.cs @@ -11,7 +11,8 @@ public class Ennemy : MonoBehaviour private SpriteRenderer _sr; private Transform _player; - public float Life = 100; + public static float StartLife = 100; + public float Life; public float Speed = .1f; public int Damages = 1; @@ -19,6 +20,7 @@ public class Ennemy : MonoBehaviour private void Awake() { + Life = StartLife; if (transform.parent != null) { transform.parent = null; @@ -30,6 +32,8 @@ public class Ennemy : MonoBehaviour _sr = GetComponent(); _player = GameObject.FindGameObjectWithTag("Player").transform; + + InvokeRepeating(nameof(UpgradeSelf), 2f, 10f); } private void Update() @@ -125,4 +129,10 @@ public class Ennemy : MonoBehaviour yield return new WaitForSeconds(.1f); } } + + private void UpgradeSelf() + { + Damages += 15; + StartLife += 5; + } }