Fixed demon to patron ratio issue.
This commit is contained in:
parent
e5d23e27fa
commit
7559650d35
8 changed files with 12 additions and 4 deletions
|
|
@ -1903,6 +1903,7 @@ MonoBehaviour:
|
||||||
shankYouText: {fileID: 644799324}
|
shankYouText: {fileID: 644799324}
|
||||||
gameOverText: {fileID: 973833019}
|
gameOverText: {fileID: 973833019}
|
||||||
restartText: {fileID: 1894191159}
|
restartText: {fileID: 1894191159}
|
||||||
|
patronCounter: 0
|
||||||
--- !u!4 &1164596950
|
--- !u!4 &1164596950
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ public class GameController : MonoBehaviour {
|
||||||
public GUIText restartText;
|
public GUIText restartText;
|
||||||
|
|
||||||
private int score = 0;
|
private int score = 0;
|
||||||
private int patronCounter = 0;
|
public int patronCounter = 0;
|
||||||
private bool restart;
|
private bool restart;
|
||||||
private int maxSwigs;
|
private int maxSwigs;
|
||||||
|
|
||||||
|
|
@ -40,6 +40,8 @@ public class GameController : MonoBehaviour {
|
||||||
if (Input.GetKeyDown(KeyCode.R))
|
if (Input.GetKeyDown(KeyCode.R))
|
||||||
Application.LoadLevel(Application.loadedLevel);
|
Application.LoadLevel(Application.loadedLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Debug.Log (currentNumberOfDemons + "/" + patronCounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator SpawnWaves ()
|
IEnumerator SpawnWaves ()
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ public class Patron : MonoBehaviour {
|
||||||
else
|
else
|
||||||
Debug.Log("Cannot find GameController script.");
|
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;
|
isDemon = true;
|
||||||
gameController.currentNumberOfDemons++;
|
gameController.currentNumberOfDemons++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,11 @@ public class WalkAI : MonoBehaviour {
|
||||||
|
|
||||||
GameObject poi1 = allPois[Random.Range (0, allPois.Length)];
|
GameObject poi1 = allPois[Random.Range (0, allPois.Length)];
|
||||||
GameObject poi2 = 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] {
|
destinations = new GameObject[2] {
|
||||||
poi1,
|
poi1,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ Material:
|
||||||
second:
|
second:
|
||||||
m_Texture: {fileID: 2800000, guid: 26c9dff0fed396341b045e42e3a0b500, type: 3}
|
m_Texture: {fileID: 2800000, guid: 26c9dff0fed396341b045e42e3a0b500, type: 3}
|
||||||
m_Scale: {x: 1, y: .5}
|
m_Scale: {x: 1, y: .5}
|
||||||
m_Offset: {x: 0, y: 0}
|
m_Offset: {x: 0, y: .5}
|
||||||
data:
|
data:
|
||||||
first:
|
first:
|
||||||
name: _BumpMap
|
name: _BumpMap
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -56,7 +56,7 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
u.initPlugin(jQuery("#unityPlayer")[0], "Builds.unity3d");
|
u.initPlugin(jQuery("#unityPlayer")[0], "DemonShanker2.unity3d");
|
||||||
});
|
});
|
||||||
-->
|
-->
|
||||||
</script>
|
</script>
|
||||||
BIN
Builds/DemonShanker2.unity3d
Normal file
BIN
Builds/DemonShanker2.unity3d
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue