I'm trying to learn the methods of LibGDX and I've started a project, it's the old Atari Lunar Landscape game.
I simply want to generate the following "scenario"
I just want to do what amounts to mountains, and of course I have the following things in mind to do it in a "random" way.
Have the following variable:
int NumeroPuntos
This variable will receive a random number between 30 and a maximum yet to be determined to see how many geometric points the map will be formed and then join these points with a ShapeRender
.
But I can't think of any way to generate a "uniform" mountain, that is to say that it has the shape of a mountain and also that it has uniform parts that serve as a base (which are the ones that say x2, x5, x3...)
And the last question regarding this is, how to make more maps be generated? that is, is there any method to move the current screen so to speak and generate another one?
For example if my "Screen" has value x = 100
, and value y = 30
, can I draw outside the screen so that when the screen moves it is automatically generated?
Well I can't comment due to my low reputation, but here's a comment-reply.
Do you want to connect dots?
ShapeRenderer has the option to draw lines, you just have to provide the vertices (or points)
Can you create more points off the screen?
Yes, you would have to use
OrthographicCamera
, using a camera you would have the facility to put the center of the camera on the player, so the camera will always follow the playerRemember to delete the points as they go off the screen, since you will be drawing the lines of these points without any purpose