BTB - Organic Blocks - Qui - levelgen
By no means inspired by a persisting minecraft addiction. This post now with 100% fewer lies, guaranteed. And now back to your previously scheduled verifiable post content. The level is shorter than the levelgen, which is always a good sign. Alright, maybe that second part is totally true as well. Which means it is not, or something. Honest. But seriously, folks, if you can come up with a more efficient levelgen that does the same thing, I will be very, very surprised and incredibly annoyed. Truly this time. Not really.
And, of course, the levelgen.
And, of course, the levelgen.
- Code:
- local rows = {}
local rowsb = {}
for i = 1, 25 do
rows[i] = {}
rowsb[i] = {}
for j = 1, 25 do
rows[i][j] = math.random(10)
rowsb[i][j] = rows[i][j]
end
end
for i = 1, 25 do
for j = 1, 25 do
if(i-1 >= 1) then
rowsb[i][j] = rowsb[i][j] + (rows[i-1][j])/2
end
if(i+1 <= 25) then
rowsb[i][j] = rowsb[i][j] + (rows[i+1][j])/2
end
if(j-1 >= 1) then
rowsb[i][j] = rowsb[i][j] + (rows[i][j-1])/2
end
if(j+1 <= 25) then
rowsb[i][j] = rowsb[i][j] + (rows[i][j+1])/2
end
if (rowsb[i][j] >= 19) then
levelgen:addLevelLine("BarrierMaker 50 " .. i/5 .. " " .. j/5 .. " " .. i/5 .. " " .. (j + 1)/5)
end
end
end
Qui ckRime