Page 1 of 1

BTB - Organic Blocks - Qui - levelgen

PostPosted: Tue Oct 05, 2010 8:13 pm
by Qui
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.
  Code:
GameType 4 20
LevelName Organic Blocks
LevelDescription
LevelCredits
Script orgo.levelgen
GridSize 255
MinPlayers 0
MaxPlayers 0
Team Bacteriums 0 0.8 0.3
BarrierMaker 50 -0.3 5.6  5.5 5.6  5.5 -0.2  -0.3 -0.2  -0.3 5.6
Spawn 0 0 0.1
Spawn 0 0 5.3
Spawn 0 5.2 5.3
Spawn 0 5.2 0.1
 

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

Re: BTB - Organic Blocks - Qui - levelgen

PostPosted: Wed Oct 05, 2011 10:47 pm
by ZoombeR
Very interesting. I want to encourage other to go to levelgens. Once you figure them out, they're easy as jack from there. We don't have enough levelgens, and our map collection would certainly get better with more.

Re: BTB - Organic Blocks - Qui - levelgen

PostPosted: Wed Feb 13, 2013 12:58 am
by Quartz
This is good, I like this.