Fixed demon to patron ratio issue.

This commit is contained in:
shakurass 2014-04-30 13:48:51 -06:00
commit 7559650d35
8 changed files with 12 additions and 4 deletions

View file

@ -19,7 +19,7 @@ public class GameController : MonoBehaviour {
public GUIText restartText;
private int score = 0;
private int patronCounter = 0;
public int patronCounter = 0;
private bool restart;
private int maxSwigs;
@ -40,6 +40,8 @@ public class GameController : MonoBehaviour {
if (Input.GetKeyDown(KeyCode.R))
Application.LoadLevel(Application.loadedLevel);
}
// Debug.Log (currentNumberOfDemons + "/" + patronCounter);
}
IEnumerator SpawnWaves ()

View file

@ -18,7 +18,7 @@ public class Patron : MonoBehaviour {
else
Debug.Log("Cannot find GameController script.");
if (Random.value > 0.6 && gameController.currentNumberOfDemons < (gameController.maxPatrons / 4)) {
if (Random.value >= 0.75 || gameController.currentNumberOfDemons < (gameController.patronCounter / 4)) {
isDemon = true;
gameController.currentNumberOfDemons++;
}

View file

@ -14,6 +14,11 @@ public class WalkAI : MonoBehaviour {
GameObject poi1 = allPois[Random.Range (0, allPois.Length)];
GameObject poi2 = allPois[Random.Range (0, allPois.Length)];
while (poi2 == poi1) {
poi2 = allPois[Random.Range (0, allPois.Length)];
}
Debug.Log (poi1.name + "," + poi2.name);
destinations = new GameObject[2] {
poi1,