using UnityEngine;
using System.Collections;

public class dropthatbass : MonoBehaviour {

    public GameObject bassbox;
    public GameObject playerRef;
    public int difficulty = 1;
    // Use this for initialization
    void Start () {
        playerRef = GameObject.FindGameObjectWithTag("Player");
    }

    void BassMakeBeat() {
        for (int l = 0; l < difficulty; l++)
        {
            Instantiate(bassbox, new Vector3(Random.Range(-11, 11), 19, Random.Range((playerRef.transform.position.z - 40), (playerRef.transform.position.z - 10))), gameObject.transform.rotation);
            //if (GameObject.FindGameObjectWithTag("BassShock")) {
            //    GameObject.FindGameObjectWithTag("BassShock").tag = "Bass";
            //}
            //bassbox.tag = "BassShock";
        }
    }

	// Update is called once per frame
	void Update () {
        if (Input.GetKeyDown("r"))
        {
            BassMakeBeat();
        }
    }
}
