I need to randomly draw caves... I have written a program which does the opposite of what I need it to do but I lost it and I have no idea how I did it. Imagine a screen with the dimensions 94*62, two numbers are selected at random (rand94, rand62), something has to happen between these numbers where as these numbers get closer to the middle of the screen, the radius of the circle is larger. Code:
1 2 3 4 5 6 7 8
While (N>0)
{
N = N -1;
A = Rand94;
B = Rand62;
//Equasion to find C, the radius
Circle(A,B,C); //draws a circle
}
I'm thinking something parabolic where the vertex of a downward-facing parabola. Something like: y = -(x - midpoint_x)^2 + midpoint_x^2. It would give you something very regular, but it would be a start.
That's exactly what I was thinking but I don't remember writing that in the other program. Let me check that equation... It goes a little high, the equation -0.05(X -midpoint_x)^2+max_y is better suited. Just to let you know, xmin=0, ymin=0, xmax=94 and ymax=62 so -0.05(X-47)^2+62 is the fitting equation.
Thanks but I'm not sure if using parabolas will work but it's a great way of visualising what I'm trying to do.
After some experimentation, I have found a definite point using the equation, I will edit the post to reflect this: