Exemplo n.º 1
0
        void AddLowerGrowth(Node node, Node[,] grid, int growthHeight, Texture2D tex)
        {
            ColorGradient gradient = TerrainType.GetBottomGradient();

            if (growthHeight > 5)
            {
                growthHeight = 5;
            }
            for (int y = 0; y < growthHeight + 1; y++)
            {
                int curY = node.Position.y - y;
                if (curY < 0)
                {
                    return;
                }

                grid[node.Position.x, curY].Solid = true;
                grid[node.Position.y, curY].Type  = NodeType.Land;                      //Overrides floating, etc

                Color col = gradient.Colors[y];
                col.a = 1.0f;
                tex.SetPixel(node.Position.x, curY, col);
            }
        }
Exemplo n.º 2
0
        void AddUpperGrowth(Node node, Node[,] grid, int growthHeight, Texture2D tex)
        {
            ColorGradient gradient = TerrainType.GetTopGradient();

            if (growthHeight > 6)
            {
                growthHeight = 6;
            }
            for (int y = 1; y < growthHeight + 1; y++)
            {
                int curY = node.Position.y + y;
                if (curY >= height)
                {
                    return;
                }

                grid[node.Position.x, curY].Solid = true;
                grid[node.Position.x, curY].Type  = NodeType.Land;              //Overrides floating, etc

                Color col = gradient.Colors[growthHeight - y];
                col.a = 1.0f;
                tex.SetPixel(node.Position.x, curY, col);
            }
        }