Patrons now spawn in and are randomly assigned demon status.

This commit is contained in:
shakurass 2014-04-27 19:49:21 -06:00
commit 5d203d1e9d
12 changed files with 111 additions and 1189 deletions

View file

@ -2,8 +2,10 @@
using System.Collections;
public class Patron : MonoBehaviour {
public Renderer characterSprite;
private GameController gameController;
private bool isDemon = false;
void Start() {
GameObject gameControllerObject = GameObject.FindWithTag("GameController");
@ -12,6 +14,9 @@ public class Patron : MonoBehaviour {
gameController = gameControllerObject.GetComponent <GameController> ();
else
Debug.Log("Cannot find GameController script.");
if (Random.value > 0.6)
isDemon = true;
}
void OnTriggerEnter(Collider other) {
@ -20,7 +25,14 @@ public class Patron : MonoBehaviour {
{
//Instantiate (playerExplosion, other.transform.position, other.transform.rotation);
Destroy(gameObject);
gameController.DetractScore ();
if(isDemon)
gameController.AddScore ();
else
gameController.DetractScore ();
}
if (other.tag == "VVAura" && isDemon) {
characterSprite.renderer.material.color = Color.red;
}
}
}