Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x0 = 7
- local y0 = 1
- local feinixxColor = 512
- local fireColors = {2, 16, 16384}
- local amtFireColors = 3
- local onFire = {0, 0, 0, 0, 0, 0, 0}
- local catchFireWeight = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 4, 5}
- local catchFireLen = 15
- local fireXPos = {1, 6, 12, 18, 24, 30, 36}
- local sleepTime = .2
- local stepDownBig = 10
- local stepDownSmall = 5
- local m = peripheral.wrap("right")
- m.clear()
- m.setTextScale(.5)
- function drawFeinixx()
- m.setTextColor(feinixxColor)
- m.setCursorPos(x0+1,y0+4)
- m.write(" ____")
- m.setCursorPos(x0+1,y0+5)
- m.write("| __| ___ ___ _ _ ___ __ ____ __")
- m.setCursorPos(x0+1,y0+6)
- m.write("| |_ | __||_ _| | \\| ||_ _| \\ \\/ /\\ \\/ /")
- m.setCursorPos(x0+1,y0+7)
- m.write("| _| | _| | | | .' | | | > < > <")
- m.setCursorPos(x0+1,y0+8)
- m.write("|_| |___||___| |_|\\_||___| /_/\\_\\/_/\\_\\ ")
- end
- function drawFlame1(px, py)
- local ver = math.random(2)
- local col = math.random(amtFireColors)
- m.setTextColor(fireColors[col])
- if ver == 1 then
- m.setCursorPos(px+2,py)
- m.write(")")
- m.setCursorPos(px+1, py+1)
- m.write("/(")
- elseif ver == 2 then
- m.setCursorPos(px+2,py)
- m.write("(")
- m.setCursorPos(px+1, py+1)
- m.write(")\\ ")
- end
- m.setCursorPos(px+3, py+2)
- m.write(")")
- m.setTextColor(fireColors[(col+1)%amtFireColors])
- m.setCursorPos(px, py+2)
- m.write("(_)")
- end
- function drawFlame2(px, py)
- local ver = math.random(2)
- local col = math.random(amtFireColors)
- m.setTextColor(fireColors[col])
- if ver == 1 then
- m.setCursorPos(px+2,py)
- m.write("(")
- m.setCursorPos(px+1, py+1)
- m.write(")\\ ")
- elseif ver == 2 then
- m.setCursorPos(px+2,py)
- m.write(")")
- m.setCursorPos(px+1, py+1)
- m.write("/(")
- end
- m.setCursorPos(px, py+2)
- m.write("(")
- m.setTextColor(fireColors[(col+1)%amtFireColors])
- m.setCursorPos(px+1, py+2)
- m.write("(_)")
- end
- function drawFlame3(px, py)
- local ver = math.random(2)
- local col = math.random(amtFireColors)
- m.setTextColor(fireColors[col])
- if ver == 1 then
- m.setCursorPos(px+2,py)
- m.write("(")
- m.setCursorPos(px+1, py+1)
- m.write(")\\ ")
- elseif ver == 2 then
- m.setCursorPos(px+2,py)
- m.write(")")
- m.setCursorPos(px+1, py+1)
- m.write("/(")
- end
- m.setCursorPos(px, py+2)
- m.write("(())")
- m.setTextColor(fireColors[(col+1)%amtFireColors])
- m.setCursorPos(px+1, py+2)
- m.write("()")
- end
- function drawBigFlame1(px, py)
- drawFlame1(px, py+2)
- drawFlame3(px, py)
- drawFlame1(px+2, py+1)
- end
- function drawBigFlame2(px, py)
- drawFlame2(px+2, py+2)
- drawFlame3(px+2, py)
- drawFlame2(px, py+1)
- end
- while true do
- m.clear()
- drawFeinixx()
- for k,v in pairs(onFire) do
- local stepDown = 0
- local vtemp = v
- if v == 0 then -- not on fire
- vtemp = catchFireWeight[math.random(catchFireLen)]
- end
- if v == 1 then --small fire
- drawFlame2(x0+fireXPos[k]+1, y0+3)
- if math.random(stepDownSmall)%stepDownSmall == 1 then stepDown = 1 end
- end
- if v == 2 then --small fire
- drawFlame1(x0+fireXPos[k]+1, y0+3)
- if math.random(stepDownSmall)%stepDownSmall == 1 then stepDown = math.random(2) end
- end
- if v == 3 then --small fire
- drawFlame3(x0+fireXPos[k]+1, y0+3)
- if math.random(stepDownSmall)%stepDownSmall == 1 then stepDown = math.random(3) end
- end
- if v == 4 then --big fire
- drawBigFlame1(x0+fireXPos[k], y0+1)
- if math.random(stepDownBig)%stepDownBig == 1 then stepDown = math.random(3) end
- end
- if v == 5 then --big fire
- drawBigFlame2(x0+fireXPos[k], y0+1)
- if math.random(stepDownBig)%stepDownBig == 1 then stepDown = math.random(3) end
- end
- onFire[k] = tonumber(vtemp)-tonumber(stepDown)
- end
- sleep(sleepTime)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement