Fixed a bug where enemies would spawn instantly if no other enemies were in the game as oppossed to waiting 1-3 seconds

This commit is contained in:
Gregory Campbell
2020-07-11 19:04:21 -04:00
parent 86c009379c
commit 1deb85510d
+2 -2
View File
@@ -108,9 +108,9 @@ public class GMScript : MonoBehaviour
enemyTime = 0.0f;
}
if(GameObject.FindWithTag("Enemy") == null)
if(GameObject.FindWithTag("Enemy") == null && enemySpawnTime - enemyTime > 3.0f)
{
enemySpawnTime = Random.Range(1.0f, 3.0f);
enemySpawnTime = enemyTime + Random.Range(1.0f, 3.0f);
}
}