Exemple #1
0
    public void makeWall(ThuileInfo info)
    {
        if (info.cooX == 0 || info.cooY == 0 || info.cooX == XSize - 1 || info.cooY == YSize - 1)
        {
            if (realsquarebool)
            {
                info.Hauteur = 5;
            }
            if (lanscapebool || squarebool)
            {
                info.Hauteur = 10;
            }

            info.hasPickup = false;
            info.HasChest  = false;
        }
    }
Exemple #2
0
    public void GenerateMap(int mapLongeur, int mapLargeur, int ProbOfChest)
    {
        for (int x = 0; x < mapLargeur; x++)
        {
            for (int y = 0; y < mapLongeur; y++)
            {
                if (squarebool || lanscapebool)
                {
                    Thuile = Instantiate(thuilePrefab);
                }
                if (realsquarebool)
                {
                    Thuile = Instantiate(squareThuile);
                }

                ThuileInfo TI = Thuile.GetComponent <ThuileInfo>();
                TI.cooX = x;
                TI.cooY = y;
                if (squarebool || realsquarebool)
                {
                    TI.Hauteur       = Random.Range(0f, 1f);
                    TI.multiplicator = 1f;
                }
                if (lanscapebool)
                {
                    TI.Hauteur       = Random.Range(0f, 4f);
                    TI.multiplicator = 0.25f;
                }

                TI.ChestPrefab  = ChestPrefab;
                TI.HasChest     = generatingChest(10);
                TI.pickupPrefab = PickupPrefab;
                TI.hasPickup    = generatingPickup(2);
                makeWall(TI);
            }
        }
    }