diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-10-14 22:07:19 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-10-14 22:07:19 +0200 |
commit | fae01da58dbea66af402807d7409fa53602f71fa (patch) | |
tree | d36ddc2874f4e9fa2e08d778731301591b4cf6ee /td/Assets/Scripts/Enemy.cs | |
parent | 34d9955d2fcf232994ae6549b10e670c920b4ec9 (diff) | |
download | TD-fae01da58dbea66af402807d7409fa53602f71fa.tar.gz TD-fae01da58dbea66af402807d7409fa53602f71fa.zip |
Finished wavesystem. Should improve graph for how many enemies should spawn each time
Diffstat (limited to 'td/Assets/Scripts/Enemy.cs')
-rw-r--r-- | td/Assets/Scripts/Enemy.cs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/td/Assets/Scripts/Enemy.cs b/td/Assets/Scripts/Enemy.cs index 20436db..4d15b64 100644 --- a/td/Assets/Scripts/Enemy.cs +++ b/td/Assets/Scripts/Enemy.cs @@ -10,6 +10,7 @@ public class Enemy : MonoBehaviour { public int InitialHp; // HealthPoints public int Damage; public List<Vector3> Waypoints; // Pathway waypoints, should be set by the spawner + [Header("Scripting vars")] public Player Player; // Reference to the player object, should be set when instantiating @@ -29,6 +30,7 @@ public class Enemy : MonoBehaviour { // Selfdestruct if object reached the end if (_waypointNum + 1 >= Waypoints.Count) { + WaveSpawner.EnemiesAlive--; Player.DecreaseHealth (Damage); Destroy (gameObject); return; |