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

public class Ground : MonoBehaviour
{
    public GameObject BubblePrefab;
    public GameObject PropPrefab;
    public int level = 3;
    public int hight = 4;
    public int maxWidth = 10;
    public int delta = 1;
    public int rate = 100;

    void Start()
    {
        for(int i = level; i >= 0; i--)
        {
            int radius = maxWidth / 2;
            for(int j = -radius; j < radius; j++)
            { 
                for(int k = -radius; k < radius; k++)
                {
                    Instantiate(BubblePrefab, new Vector3(j, i*4, k), Quaternion.identity);
                    int rdm = Random.Range(0, rate);
                    if(rdm == 0)
                    {
                        Instantiate(PropPrefab, new Vector3(j, i * 4, k), Quaternion.identity);
                    }
                }
            }
            maxWidth -= delta;
        }
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
