From 02583022437b5daff957ad3552a6307a0756a65c Mon Sep 17 00:00:00 2001 From: shakurass Date: Sun, 27 Apr 2014 22:02:53 -0600 Subject: [PATCH] merging the n nightmare --- Assets/Scenes/Main.unity | 4 ++-- Assets/Scripts/GameController.cs | 3 +++ Assets/Scripts/Patron.cs | 4 +++- Assets/Sprites/Materials/brickwal-not-animatedl0.mat | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index da4b4e1..a32e1e0 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -2489,10 +2489,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: cc84b14a55660b643805ae0f1878c40b, type: 3} m_Name: m_EditorClassIdentifier: - swigs: 10 + swigs: 20 swigText: {fileID: 493161367} scoreText: {fileID: 621151321} - maxPatrons: 10 + maxPatrons: 20 spawnWait: .5 startWait: 1 waveWait: 1 diff --git a/Assets/Scripts/GameController.cs b/Assets/Scripts/GameController.cs index 5ac97b7..e16b1a7 100644 --- a/Assets/Scripts/GameController.cs +++ b/Assets/Scripts/GameController.cs @@ -12,6 +12,8 @@ public class GameController : MonoBehaviour { public float waveWait; public GameObject[] patronObjects; + public int currentNumberOfDemons = 0; + public GUIText shankYouText; public GUIText gameOverText; public GUIText restartText; @@ -86,6 +88,7 @@ public class GameController : MonoBehaviour { score += 100; UpdateScoreText (); patronCounter--; + currentNumberOfDemons--; } public void DetractScore() { diff --git a/Assets/Scripts/Patron.cs b/Assets/Scripts/Patron.cs index 3d776a5..30f56ac 100644 --- a/Assets/Scripts/Patron.cs +++ b/Assets/Scripts/Patron.cs @@ -18,8 +18,10 @@ public class Patron : MonoBehaviour { else Debug.Log("Cannot find GameController script."); - if (Random.value > 0.6) + if (Random.value > 0.6 && gameController.currentNumberOfDemons < (gameController.maxPatrons / 4)) { isDemon = true; + gameController.currentNumberOfDemons++; + } } void OnTriggerEnter(Collider other) { diff --git a/Assets/Sprites/Materials/brickwal-not-animatedl0.mat b/Assets/Sprites/Materials/brickwal-not-animatedl0.mat index 089d98c..3b9a9ab 100644 --- a/Assets/Sprites/Materials/brickwal-not-animatedl0.mat +++ b/Assets/Sprites/Materials/brickwal-not-animatedl0.mat @@ -19,7 +19,7 @@ Material: second: m_Texture: {fileID: 2800000, guid: 26c9dff0fed396341b045e42e3a0b500, type: 3} m_Scale: {x: 1, y: .5} - m_Offset: {x: 0, y: 0} + m_Offset: {x: 0, y: .5} data: first: name: _BumpMap