using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ShotScript : MonoBehaviour {
    public Transform cloud;

    // Use this for initialization
    void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
	}

    void OnCollisionEnter2D(Collision2D collision)
    {

        if (collision.gameObject.tag == "Guy") return;
        if (collision.gameObject.tag == "Shot") return;

        Transform t = Instantiate(cloud, this.transform.position, Quaternion.identity);
        t.Rotate(new Vector3(0, 0, Random.Range(-90, 90)));
        t.GetComponent<SpriteRenderer>().color = new Color(0, 1, 0);
        PlayerPrefs.SetInt("NeedShotPuff", 1);
        Destroy(gameObject);
         

    }
}


