Generate 2D terrain like hill climb racing / tiny wings ?

I work at a bike game with libGDX and box2d, i want to generate my terrain dynamically.

Something like the hill climb racing or tiny wings terrain, and I need it like in parts, one part would be a Array List of points…

When the bike is close to the end, i’ll create another part, etc.

Something like this

http://s2.postimg.org/44vxb13zd/rect3759.png

Do you guys anywhere to find to do something like this?
The terrain should not go back.

You can use 1D perlin / simplex noise.

Or just generate a few random numbers, and smooth them out, and interpolate them afterwards to create your terrain.

Generate a few random points, (optionally you can apply some smoothing) use cubic bezier to get a nice curve and then sample your path with your desired resolution. You can use the result as a box2d shape for physics and as a terrain to render. :slight_smile:

Thanks, i’ve succesfully did this.

Outputs:
http://postimg.org/gallery/n9a8nhv6/

Not bad, but you would get smoother looking results if you would increase the distance between your generated points on the x axis, or if you would generate less points. Increasing amplitude could also help in getting that hill-valley look.

I think that it looks not smooth because of libgdx shaperenderer that is not smooth , if i texture my terrain it will look smooth :smiley:

Did that just happen?..

Someone asked a question, listened and got it done. You are the 1% lol.

Haha it happens!

The output in the game

k12y8rb5wsk

Hi Fainosag,

I am also making such a game, how did you make this irregular type of 2d terrain?
What tools did u use for making this?

Dem bike seems a bit springy :smiley: