using UnityEngine;
using System.Collections;

public class BigExplosionScript : MonoBehaviour {

	public Vector3 initialPosition;
	public float radius;
	public int numExplosions;
	int countExplosions;
	public AudioSource source;

	void Start(){
		countExplosions = 0;

	}

	public void DestroyMe()
	{
		if (countExplosions > numExplosions) {
			Destroy (this.gameObject);
		}
	}

	public void WarpMe()
	{
		this.transform.position = initialPosition + new Vector3 (Random.Range (-radius, radius), Random.Range (-radius, radius), 0);
		countExplosions++;
	}

	public void PlayMyAudio()
	{
		this.source.Play ();
	}
}
