Original Post
I'm trying to randomly generate a 2D terrain (in worms-like 2D games) but so far I'm not pleased with my result. what I do is randomly generate points, and draw lines between them. I tried to limit the delta between 2 near points, increasing\decreasing the distance between points, and still, I get rough, edgy results. is there a way to "smooth" the results? Thanks! here is the code:
m_Points[0].x = 0;
m_Points[0].y = hge->Random_Float(200,250);
for (int i=1; i<Length; i++)
{
m_Points.x = i * 8;
newy = hge->Random_Float(200,400);
while (abs(newy-m_Points[i-1].y)>4)
{
newy = hge->Random_Float(200,250);
}
m_Points.y = newy;
}
here is a URL for the screenshot. http://www.largeimagehost.com/img/new-gallery-name/ehQsUhU/example.JPG.html