﻿using UnityEngine;
using System.Collections;

public class Boulders : MonoBehaviour {

	public GameObject[] boulders;

	float interval = 0.1f;
	float timer = 0f;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		if (Time.time > timer + interval) {
			timer = Time.time;
			Instantiate (
				boulders [(int)Random.Range (0, boulders.Length)],
				new Vector3 (Random.Range (-40f, 0), Random.Range (30f, 60f), Random.Range (0f, 60f)),
				Quaternion.identity
			);
		}
	}
}
