Friday, December 04, 2015

John's Boss Script

using UnityEngine;
using System.Collections;

public class BossController : MonoBehaviour {

    public float bossHealth;
    public GameObject explosion;
    public int scoreValue;

    private GameController gameController;

    void OnTriggerEnter (Collider other)
    {
        if (other.CompareTag ("Boundary") || other.CompareTag ("Enemy"))
        {
            return;
        }
        bossHealth = bossHealth - 1;
            if (bossHealth == 0)
        { 
            Instantiate (explosiontransform.positiontransform.rotation);
            Destroy (gameObject);
            gameController.AddScore (scoreValue);

    }
}
}

No comments: