using UnityEngine;
using System.Collections;

public class explosionAnim : MonoBehaviour {

    public GameObject explosion;
    bool hascollided = false;
 
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

    void OnTriggerEnter2D(Collider2D col)
    {
        if (col.tag == "surface" && hascollided == false)
        {
            Instantiate(explosion, gameObject.transform.position, gameObject.transform.rotation);
            hascollided = true;
        }
    }

}
