so i have been trying to make a game that generates a random map that is just 2d, and basically just want to have bricks made across the screen. Using
distance = 100
for z = 1, 100 do
rect(z * distance,100, 100,100)
I can make a flat landscape with no gaps, but on higher up sections of the screen I want to have bricks only in certain area to make the landscape more rugged. I have tried using
distance = math.random(100,1000)
before the for, do statement, but it just makes the bricks generate in the same spot then move away from each other. Does anyone know how to make it so the the bricks are a random distance from each other, but not the same random distance either, a different distance between each brick? Really stuck, having trouble. Help appreciated.