Exemplo n.º 1
0
    // Basic Functions

    private void FillLayer(Tile_OLD.Layer layer, Tile_OLD.Type obj)
    {
        for (int x = 0; x < worldWidth; x += 2)
        {
            for (int z = 0; z < worldHeight; z += 2)
            {
                worldData[(int)layer, x, z] = obj;
            }
        }
    }
Exemplo n.º 2
0
    private void GenerateRandom(Tile_OLD.Layer layer, Tile_OLD.Type obj, int percent, bool blockAdjacent)
    {
        for (int x = 0; x < worldWidth; x++)
        {
            for (int z = 0; z < worldHeight; z++)
            {
                if (Random.Range(0, 100) < percent)
                {
                    if (worldData[(int)layer, x, z] == Tile_OLD.Type.Open)
                    {
                        worldData[(int)layer, x, z] = obj;

                        if (blockAdjacent)
                        {
                            BlockAdjacent(layer, x, z);
                        }
                    }
                }
            }
        }
    }