Ok, so I want to be able to create a random terrain in a 2D game.
Now I know that I can store the values into a multi-dimensional array, with different numbers meaning different things, for example, 0 = air, 1 = stone.
I could also probably use a loop and a random to generate these values.
However, I want it to follow a set of specific rules, because I don’t want to have floating bits of stone in mid air, so I want the first couple of rows to be air and I want the last couple of rows to be a mixture of stone and possible ores.
How can I go about doing this in Java2D?
I don’t need to know about rendering it, just actually generating it to follow pre-defined rules.