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

public class BumpSound : MonoBehaviour {
	public AudioClip[] bumps;

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

	void OnCollisionEnter2D (Collision2D col) {
		if (col.collider.tag == "BadItem" && col.collider.GetComponent<StartNoclip> ().alreadyDead == false) {
			AudioSource audio = GetComponent<AudioSource> ();
			audio.clip = bumps [Random.Range (0, bumps.Length)];
			audio.Play ();
		}
	}
}
