Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.setTextColor(colors.lime)
- local size={term.getSize()}
- local tPixels={}
- for x=1,size[1]-1 do
- tPixels[x]={}
- for y=1,size[2] do
- tPixels[x][y]=' '
- end
- end
- local function render()
- term.clear()
- term.setCursorPos(1,1)
- for y=1,#tPixels[1] do
- if y~=1 then
- print('')
- end
- for x=1,#tPixels do
- if tPixels[x][y+1] == ' ' and tPixels[x][y] ~= ' ' then
- term.setTextColor(colors.white)
- else
- term.setTextColor(colors.lime)
- end
- write(tPixels[x][y])
- end
- end
- end
- local function cycle()
- for x=1,#tPixels do
- for y=#tPixels[x],2,-1 do
- tPixels[x][y]=(tPixels[x][y-1]==' ' and ' ') or ((tPixels[x][y]~=' ' and tPixels[x][y]) or string.char(math.random(32,126)))
- end
- --[[for x=1,#tPixels do
- local intC=nil
- for y=2,5 do
- if tPixels[x][y]==' ' then
- intC=true
- end
- end
- if not intC then
- tPixels[x][1]=' '
- end
- end]]
- end
- end
- local function create()
- tPixels[math.random(1,#tPixels)][1]=string.char(math.random(32,126))
- tPixels[math.random(1,#tPixels)][1]=' '
- tPixels[math.random(1,#tPixels)][1]=' '
- end
- local bRunning=true
- local i = 1
- while bRunning do
- --i = (i + 1) % 3
- cycle()
- --if i == 1 then
- create()
- --end
- render()
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement