Commit 15fabfcd authored by Andrew Van Buren's avatar Andrew Van Buren
Browse files

Fixed boss projectile

parent 9b47466b
......@@ -9,8 +9,8 @@ public class Actions : MonoBehaviour {
public GameObject currentAbility = null; // Which ability is currently active
private int abilitiesCounter = 0; // A counter which lets you cycle through the abilities
private Image abilitiesImage; // Picture which shows which ability it active
private GameObject myShield;
public GameObject gameOver;
private GameObject myShield;
private Text gameOver;
public int health;
......@@ -43,7 +43,8 @@ public class Actions : MonoBehaviour {
void Start () {
gameOver = GameObject.FindGameObjectWithTag("Game Over");
gameOver = GameObject.FindGameObjectWithTag("Game Over").GetComponent<Text>();
gameOver.enabled = false;
abilitiesImage = GameObject.FindGameObjectWithTag ("Cycle").GetComponent<Image>();
// Set the initial ability to something so that it's not null
CycleAbility();
......@@ -195,7 +196,7 @@ public class Actions : MonoBehaviour {
IEnumerator GameOver() {
Time.timeScale = 0.0f;
gameOver.GetComponent<Text>().enabled = true;
gameOver.enabled = true;
float start = Time.realtimeSinceStartup;
while (Time.realtimeSinceStartup < start + 2f) {
......@@ -204,7 +205,7 @@ public class Actions : MonoBehaviour {
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
Time.timeScale = 1.0f;
gameOver.GetComponent<Text>().enabled = false;
gameOver.enabled = false;
}
IEnumerator move(){
......
......@@ -7,6 +7,9 @@ public class EnemyProjectile : MonoBehaviour {
// Does not damage player
void OnCollisionEnter2D(Collision2D col) {
if (col.transform.CompareTag("Player")) {
col.transform.SendMessage("GetHit", 1);
}
Destroy(gameObject);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment