Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function drawLines(buffer, noise)
- local size = table.getn(noise[1])
- local width = table.getn(noise)
- for y = 1, size do
- buffer:clear(colors.black)
- for x = 1, width do
- local value = noise[x][y]
- buffer:setPixel(x, value * buffer.y2, colors.lime, colors.lime, " ")
- if (x > 1) then
- buffer:loadLine(x, noise[x-1][y] * buffer.y2, x, value * buffer.y2, colors.lime, " ", colors.lime)
- end
- end
- buffer:drawBuffer(true)
- if (y ~= size) then
- sleep(0.05)
- end
- end
- end
- os.loadAPI("/noise")
- os.loadAPI("/bufferAPI")
- os.loadAPI("/blittle")
- local seed = math.random(1, 10000)
- local width, height = term.getSize()
- local buffer = bufferAPI.newBuffer(1, 1, width*2, height*3)
- local chunky = 1
- while true do
- chunky = chunky + 1
- local noise1 = noise.createNoise(32, 0, chunky, seed)
- local noise2 = noise.createNoise(32, 1, chunky, seed)
- local noise3 = noise.createNoise(32, 2, chunky, seed)
- local noise4 = noise.createNoise(32, 3, chunky, seed)
- local noise = {}
- for y = 1, 32 do
- for x = 1, 32 * 4 do
- if (noise[x] == nil) then noise[x] = {} end
- if (x <= 32) then
- noise[x][y] = noise1[x][y]
- elseif (x <= 32 * 2) then
- noise[x][y] = noise2[x - 32][y]
- elseif (x <= 32 * 3) then
- noise[x][y] = noise3[x - 32 * 2][y]
- else
- noise[x][y] = noise4[x - 32 * 3][y]
- end
- end
- end
- drawLines(buffer, noise)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement