コード例 #1
0
    private void CreateDecorationAt(int blockX, int blockY, int blockZ, IRandom random)
    {
        int trunkLength = random.RandomRange(6, 10);
        // Trunk
        CreateColumnAt(blockX, blockY, blockZ, trunkLength, BlockType.Dirt);

        // Leaves
        CreateSphereAt(blockX, blockY, blockZ + trunkLength, random.RandomRange(3, 4));
    }
コード例 #2
0
 private void CreateDecorationAt(int blockX, int blockY, int blockZ, IRandom random)
 {
     //PALM TREES
     int trunkLength = random.RandomRange(6, 10);
     // Trunk
     for (int z = blockZ + 1; z <= blockZ + trunkLength; z++)
     {
         CreateTrunkAt(blockX, blockY, z);
     }
     CreateCrossAt(blockX, blockY, blockZ + trunkLength, random.RandomRange(2, 3));
     ///PALM TREES
     //
 }
コード例 #3
0
    private bool IsAValidLocationforDecoration(int blockX, int blockY, int blockZ, IRandom random)
    {
        if (random.RandomRange(1, 1000) < 999)
        {
            return false;
        }

        return IsLocationLowEnough(blockZ) && TheSpaceHereIsEmpty(blockX, blockY, blockZ);
    }
コード例 #4
0
    private bool IsAValidLocationforDecoration(int blockX, int blockY, int blockZ, IRandom random)
    {
        if (random.RandomRange(0, 10000) < 9995)
        {
            return false;
        }

        if (!TheSpaceHereIsEmpty(blockX, blockY, blockZ - 1))
        {
            return false;
        }

        return true;
    }
コード例 #5
0
    /// <summary>
    /// Determines if a tree decoration even wants to be at this location.
    /// </summary>
    /// <param name="blockX"></param>
    /// <param name="blockY"></param>
    /// <param name="blockZ"></param>
    /// <param name="random"></param>
    /// <returns></returns>
    private bool IsAValidLocationforDecoration(int blockX, int blockY, int blockZ, IRandom random)
    {
        // We don't want TOO many trees...make it a 1% chance to be drawn there.
        if (random.RandomRange(1, 1000) < 999)
        {
            return false;
        }

        if (!IsLocationLowEnough(blockZ))
        {
            return false;
        }

        // Trees like to have a minimum amount of space to grow in.
        return TheSpaceHereIsEmpty(blockX, blockY, blockZ);
    }
コード例 #6
0
 private void CreateDecorationAt(int blockX, int blockY, int blockZ, IRandom random)
 {
     //PINE TREES
     int trunkLength = random.RandomRange(10, 20);
     // Trunk
     for (int z = blockZ + 1; z <= blockZ + trunkLength; z++)
     {
         CreateTrunkAt(blockX, blockY, z);
     }
     //leaves
     for (int z = blockZ + 3; z <= blockZ + trunkLength; z += 2)
     {
         CreateDiskAt(blockX, blockY, z, (blockZ + trunkLength - z) / 3);
     }
     CreateLeavesAt(blockX, blockY, blockZ + trunkLength);
 }
コード例 #7
0
    /// <summary>
    /// Determines if a tree decoration even wants to be at this location.
    /// </summary>
    /// <param name="blockX"></param>
    /// <param name="blockY"></param>
    /// <param name="blockZ"></param>
    /// <param name="random"></param>
    /// <returns></returns>
    private bool IsAValidLocationforDecoration(int blockX, int blockY, int blockZ, IRandom random)
    {
        // We don't want TOO many trees...make it a 1% chance to be drawn there.
        if (random.RandomRange(1, 1000) < 999)
        {
            return false;
        }

        // Trees don't like to grow too high
        if (blockZ >= m_WorldData.DepthInBlocks - 20)
        {
            return false;
        }

        // Trees like to have a minimum amount of space to grow in.
        return SpaceAboveIsEmpty(blockX, blockY, blockZ, 8, 2, 2);
    }