Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Visual Demo 1 by CrazedProgrammer
- -- This program needs the Surface API 1.3 in the same directory as the program.
- -- If the Surface API 1.3 doesn't exist it will try to download it.
- -- You can find info and documentation on these pages:
- --
- -- You may use this in your ComputerCraft OSes and modify it without asking.
- -- However, you may not publish this program under your name without asking me.
- -- If you have any suggestions, bug reports or questions then please send an email to:
- -- crazedprogrammer@gmail.com
- function draw()
- display:drawSurfaceScaled(1, 1, 51, 19, surf)
- display:render()
- os.sleep(0)
- surf:clear()
- display:clear()
- end
- local dir = fs.getDir(shell.getRunningProgram())
- if not fs.exists(dir.."/surface") or fs.isDir(dir.."/surface") then
- fs.delete(dir.."/surface")
- shell.run("pastebin get ajFj7yNK /"..dir.."/surface")
- end
- os.loadAPI(dir.."/surface")
- srf = surface.loadString("_0033000820_f20ef20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20ef20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20bf20_f20_f20bf20bf20_f20_f20bf20bf20bf20_f20_f20_f201f20_f20_f20_f20_f201f201f20_f20ef20_f20ef20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20ef20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20bf20_f20bf20_f20bf20_f20bf20_f20_f20bf20_f20_f20_f201f201f20_e20_f20_f20_f20_f20_f201f20ef20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20ef20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20_f20bf20_f20bf20_f20bf20_f20bf20_f20_f20bf20_f20_f20_f20_f201f20_f20_f20_f20_f20_f20_f201f20_f20ef20_f20_f20ef20_f20ef20_f20ef20_f20ef20_f20ef20ef20ef20_f20_f20ef20_f20_f20_f20ef20ef20_f20_f20ef20_f20_f20_f20bf20bf20bf20_e20bf20bf20_f20_f20_f20bf20_f20_f20_f20_f201f20_f20_f20_f20_f201f201f20_f20_f20_f20ef20_f20ef20_f20ef20_f20ef20ef20_f20_f20_f20ef20_f20_f20ef20_f20ef20_e20ef20_e20_e20_e20ef20_e20ef20_e20_e20bf20_e20bf20_e20bf20_e20_e20_e20_e20bf20_f20_f20_f20_f201f20_f20_f20_f20_f20_f20_e201f20_f20_f20ef20_f20ef20_f20ef20_f20ef20_f20_f20_f20_f20ef20_f20_f20ef20_f20ef20_f20ef20_f20_f20_f20ef20ef20ef20_f20_f20bf20_f20bf20_e20bf20_f20_f20_f20_f20bf20_f20_f20_f20_f201f20_f20_f20_f20_f20_f20_f201f20ef20_f20ef20_f20ef20_f20ef20_f20ef20_f20_f20_f20_f20ef20_f20_f20ef20_f20ef20_f20ef20_f20_f20_f20ef20_f20_f20_f20_f20bf20_f20bf20_f20bf20_f20_f20_f20_f20bf20_f20_f20_f20_f201f20_f20_f20_f20_f20_f20_f201f20_f20ef20_f20_f20_f20ef20ef20_f20ef20_f20_f20_f20_f20ef20_f20_f20_f20ef20ef20_f20_f20ef20ef20_f20_f20ef20ef20_f20_f20bf20_f20bf20_f20bf20_f20_f20_f20bf20bf20bf20_f20_f201f201f201f20_f201f20_f201f201f20_f")
- cp = surface.loadString("_00100010208f208f208f208f208f208f208f208f208f208f208f208f208f208f208f208f208f20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff207f208f20ff20ff200f200f20ff200f200f20ff20ff20ff20ff20ff20ff20ff207f208f20ff200f20ff20ff20ff200f20ff200f20ff20ff20ff20ff20ff20ff207f208f20ff200f20ff20ff20ff200f200f20ff20ff20ff20ff20ff20ff20ff207f208f20ff200f20ff20ff20ff200f20ff20ff20ff20ff20ff20ff20ff20ff207f208f20ff20ff200f200f20ff200f20ff20ff20ff200f200f200f20ff20ff207f208f20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff207f208f207f207f207f207f207f207f207f207f207f207f207f207f207f207f207f20_720_720_720_720_720_720_72077207720_720_720_720_720_720_720_720_720_720_720_720_720_7207720772077207720_720_720_720_720_720_720872087208720872087208720872087208720872087208720872087208720872087208720872087208720872087208720872087208720872087208720872077208720772077207720772077208720772077208720772077208720b72087207720872087208720872087208720872087208720872087208720872087208720772077207720772077207720772077207720772077207720772077207720772077")
- mario = surface.loadString("_000c001020_f20_f20_f20ef20ef20ef20ef20ef20_f20_f20_f20_f20_f20_f20ef20ef20ef20ef20ef20ef20ef20ef20ef20_f20_f20_f20cf20cf20cf204f204f20cf204f20_f20_f20_f20_f20cf204f20cf204f204f204f20cf204f204f204f20_f20_f20cf204f20cf20cf204f204f204f20cf204f204f204f20_f20cf20cf204f204f204f204f20cf20cf20cf20cf20_f20_f20_f20_f204f204f204f204f204f204f204f20_f20_f20_f20_f20ef20ef20bf20ef20ef20ef20ef20_f20_f20_f20_f20ef20ef20ef20bf20ef20ef20bf20ef20ef20ef20_f20ef20ef20ef20ef20bf20bf20bf20bf20ef20ef20ef20ef200f200f20ef20bf201f20bf20bf201f20bf20ef200f200f200f200f200f20bf20bf20bf20bf20bf20bf200f200f200f200f200f20bf20bf20bf20bf20bf20bf20bf20bf200f200f20_f20_f20bf20bf20bf20_f20_f20bf20bf20bf20_f20_f20_f20cf20cf20cf20_f20_f20_f20_f20cf20cf20cf20_f20cf20cf20cf20cf20_f20_f20_f20_f20cf20cf20cf20cf")
- mworld = surface.loadString("_0026001320df205f205f20ff203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f20ff20ff20ff20ff20ff20ff20ff203f203f203f205f205f205f20ff203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f20ff204f204f204f204f204f204f20ff203f203f203f20df205f205f20ff203f203f203f203f203f203f203f203f203f203f203f203f201f201f201f201f203f203f203f203f203f203f203f20ff204f204f204f204f20ff204f20ff203f203f203f205f205f205f20ff203f203f203f203f203f203f203f203f203f203f203f201f201f201f201f201f201f203f203f203f203f203f203f20ff204f204f204f204f20ff204f20ff203f203f203f20df205f205f20ff203f203f203f203f203f203f203f203f203f203f201f201f201f201f201f201f201f201f203f203f203f203f203f20ff204f204f204f204f20ff204f20ff203f203f203f205f205f205f20ff203f203f203f203f203f203f203f203f201f201f201f201f201f201f201f201f201f201f201f203f203f203f203f20ff204f204f204f204f20ff204f20ff203f203f203f20df205f205f20ff203f203f203f203f203f203f203f201f20ff20ff20ff201f201f201f201f201f201f20ff20ff201f203f203f203f20ff20ff204f204f204f204f20ff20ff203f203f203f205f205f205f20ff203f203f203f203f203f203f201f201f201f201f204f20ff201f201f201f201f20ff204f201f201f201f203f203f203f20ff204f20ff20ff204f20ff203f203f203f203f20df205f205f20ff203f203f203f203f203f203f201f201f201f201f204f20ff20ff20ff20ff20ff20ff204f201f201f201f203f203f20ff204f20ff204f204f20ff204f20ff203f203f203f205f205f205f20ff203f203f203f203f203f201f201f201f201f201f204f20ff204f201f201f204f20ff204f201f201f201f201f203f20ff204f204f204f204f204f204f20ff203f203f203f20df205f205f20ff203f203f203f203f203f201f201f201f201f201f204f204f204f201f201f204f204f204f201f201f201f201f203f20ff204f204f204f204f20ff204f20ff203f203f203f205f205f205f20ff203f203f203f203f203f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f203f20ff204f204f204f204f20ff204f20ff203f203f203f20df205f205f20ff203f203f203f203f203f203f201f201f201f201f201f204f204f204f204f204f204f201f201f201f201f203f203f20ff204f204f204f204f20ff204f20ff203f203f203f205f205f205f20ff203f203f203f203f203f203f203f203f203f203f204f204f204f204f204f204f204f204f203f203f203f203f203f20ff204f204f204f204f20ff204f20ff203f203f203f20df205f205f20ff203f203f203f203f203f203f203f20ff20ff20ff204f204f204f204f204f204f204f204f203f203f203f203f203f20ff20ff204f204f204f204f20ff20ff203f203f203f205f205f205f20ff203f203f203f203f203f203f20ff20ff20ff20ff20ff20ff204f204f204f204f204f20ff20ff203f203f203f203f203f20ff204f20ff20ff204f20ff203f203f203f203f20df205f205f20ff203f203f203f203f203f203f20ff20ff20ff20ff20ff20ff20ff204f204f204f20ff20ff20ff203f203f203f203f20ff204f20ff204f204f20ff204f20ff203f203f203f201f204f204f204f204f201f201f204f204f204f204f20ff20ff20ff20ff20ff20ff201f204f20ff20ff20ff201f201f204f204f204f204f204f204f204f204f20ff201f204f204f204f204f204f201f201f201f201f20ff204f201f201f201f201f201f201f201f201f201f20ff204f201f201f201f201f20ff204f201f201f201f201f201f201f201f201f20ff204f201f201f201f201f")
- trans1 = surface.loadString("_00260013203f203f203f20ff206f206f206f20ff206f206f20ff206f206f206f206f206f20ff203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f20ff20ff20ff20ff20ff20ff203f203f203f203f20ff206f206f206f206f20ff20ff20ff206f206f206f20ff203f203f203f203f203f203f203f203f203f203f203f203f20ff20ff20ff203f203f20ff20df20df20ff203f203f203f20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff203f203f203f203f203f203f203f203f203f203f203f203f20ff20ff20df20df20ff203f20ff20df20df20ff203f203f20ff20ff20ff20df20df20df20df20df20df20df20df20df20df20ff20ff203f203f203f203f203f203f203f203f203f203f203f20ff20df20df20df20df20ff20ff20df20df20ff20ff203f20ff20ff20df20df20df20df20df20df20df20df20df20df20df20df20ff203f203f203f203f203f203f203f203f203f203f203f20ff20df20df20ff20df20df20ff20df20df20ff20df203f20ff20ff20df20df20df20df20df20df20df20df20df20df20df20df20ff203f203f203f203f203f203f203f203f203f203f203f203f20ff20df20df20ff20df20ff20df20df20ff20df203f20ff20ff20df20df20df20df20df20df20df20df20df20df20df20df20ff203f203f203f203f203f203f203f203f203f203f203f203f20ff20df20df20df20ff20ff20df20df20ff20ff203f203f20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff203f203f203f203f203f203f203f203f203f203f203f203f203f20ff20ff20df20df20df20df20df20df20df203f203f20ff20ff20df20df20df20df20df20df20df20df20df20df20ff203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f203f20ff20ff20df20df20df20df20ff203f20ff200f200f20ff20df20df20df20df20df20df20df20df20df20ff203f203f203f203f203f203f203f203f203f203f203f203f203f20ff20ff20ff203f203f20ff20df20df20ff203f203f20ff200f200f200f20ff20df20df20df20df20df20df20df20ff20ff20ff203f203f203f203f203f203f203f203f203f203f203f20ff20ff20df20df20ff203f20ff20df20df20ff203f203f20ff200f200f20ff20df20df20df20df20df20df20df20df20df20df20ff20ff203f203f203f203f203f203f203f203f203f203f20ff20df20df20df20df20ff20ff20df20df20ff20ff203f20ff20ff20ff20df20df20df20df20df20df20df20df20df20df20df20df20ff203f203f203f203f203f203f203f203f203f203f20ff20df20df20ff20df20df20ff20df20df20ff20df203f20ff20ff20df20df20df20df20df20df20df20df20df20df20df20df20df20ff203f203f203f203f203f203f203f203f203f203f203f20ff20df20df20ff20df20ff20df20df20ff20df203f20ff20ff20df20df20df20df20df20df20df20df20df20df20df20df20df20ff203f203f203f203f203f203f203f203f203f203f203f20ff20df20df20df20ff20ff20df20df20ff20ff203f20ff20ff20df20df20df20df20df20df20df20df20df20df20df20df20df20ff203f203f203f203f203f203f203f203f203f203f203f203f20ff20ff20df20df20df20df20df20df20df203f20ff20ff20ff20df20df20df20df20df20df20df20df20df20df20df20ff20ff203f203f203f203f203f203f203f203f203f203f203f203f203f203f20ff20ff20df20df20df20df20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff203f203f203f20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff20ff201f201f201f201f20ff201f201f20ff203f203f203f203f203f203f203f203f203f203f203f20ff20df20df205f20df205f205f205f20df20df205f20df20df20df20df20df20df20df20df")
- trans2 = surface.loadString("_00260013203f203f203f203f203f203f203f203f20ff20ff20ff20ff20ff203f203f203f203f203f203f203f203f203f203f203f20ff20ff20ff20ff203f20ff20ff20ff203f203f203f203f203f203f203f203f203f203f203f203f20ff20ff202f206f206f206f202f20ff20ff203f203f203f203f203f203f203f203f20ff20ff200f200f20ff20ff200f200f206f20ff20ff203f203f203f203f203f203f203f203f203f20ff202f206f206f206f206f206f206f206f202f20ff203f203f203f203f203f203f203f20ff206f200f200f206f20ff206f200f200f206f206f20ff203f203f203f203f203f203f203f20ff202f206f206f206f206f206f206f206f206f206f20ff203f203f203f203f203f203f203f20ff206f20ff200f200f206f200f200f200f200f200f206f20ff203f203f203f203f203f203f20ff206f206f206f206f206f206f206f206f206f206f202f20ff203f203f203f203f203f203f20ff206f206f206f200f206f206f206f200f206f20ff20ff20ff20ff203f203f203f203f20ff206f206f206f206f206f206f206f20ff206f20ff206f202f20ff203f203f203f203f203f20ff20ff206f20ff206f200f206f206f206f200f200f206f20ff203f203f203f203f203f20ff202f206f206f206f206f206f206f206f20ff206f20ff206f206f206f20ff203f203f203f20ff200f20ff200f20ff200f206f206f206f200f200f200f200f206f20ff203f203f203f203f20ff206f206f206f206f206f206f206f206f20ff206f20ff206f206f206f20ff203f203f203f20ff200f200f206f206f206f206f206f206f206f200f200f20ff20ff203f20ff203f203f203f20ff206f206f206f206f206f202f202f206f206f206f206f202f202f206f20ff203f203f203f20ff200f200f206f206f206f206f206f206f200f200f200f200f20ff20ff203f203f203f203f20ff202f206f206f202f206f206f206f206f206f206f206f206f202f206f20ff203f203f203f20ff200f200f206f206f206f206f206f206f206f206f200f206f206f206f20ff203f203f203f203f20ff202f206f20ff206f206f206f206f206f20ff206f206f20ff202f20ff203f203f203f20ff200f20ff206f206f206f206f206f200f200f200f200f200f200f20ff203f203f203f203f203f203f20ff20ff202f206f206f206f206f206f206f206f202f20ff20ff203f203f203f203f203f20ff206f206f206f206f206f206f206f206f200f200f200f206f206f20ff203f203f203f203f203f203f20ff20ff202f202f206f206f206f206f202f20ff20ff203f203f203f203f203f203f20ff20ff20ff20ff206f206f200f200f200f200f206f20ff20ff20ff20ff203f203f203f203f203f20ff202f202f20ff20ff20ff20ff20ff20ff20ff202f202f20ff203f203f203f203f20ff206f200f200f206f20ff206f206f206f206f20ff20ff200f200f200f20ff203f203f203f203f20ff202f202f202f202f202f20ff20ff20ff20ff202f202f202f202f20ff203f203f203f20ff206f200f200f200f206f20ff20ff20ff20ff206f206f200f206f20ff203f203f20cf20cf20cf20cf20ff20ff20ff20ff20ff20cf20cf20cf20ff20ff20ff20ff20ff20cf20cf20cf20cf20cf20ff20ff20ff20ff20ff20cf20cf20cf20cf20ff20ff20ff20ff20cf20cf20cf20cf20cf20cf20cf20cf20cf20cf20cf20cf20cf20cf20cf20cf20cf20cf20cf20cf20cf20cf20cf20cf20c020c020c020c020c020c020c020c020c020c020c020c020c020c020c020c020cf201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f201f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f204f")
- surf = surface.create(38, 19)
- display = surface.create(51, 19)
- for i=1,40,1 do
- display:drawText(1, 1, "Visual Demo 1 powered by:")
- display:drawSurface(1, 5, srf)
- display:drawText(1, 18, "By CrazedProgrammer")
- draw()
- end
- for i=1,200,1 do
- local size = math.floor(14 + math.sin(i / 5) * 5)
- local surf2 = surface.create(size, size)
- surf:fillTriangle(30, 1, math.floor(math.cos(i / 10) * 30 + 15), 19, math.floor(math.cos(i / 10) * 30 + 35), 19, nil, colors.red)
- surf2:drawSurfaceScaled(1, 1, size, size, cp)
- surf:drawSurfaceRotated(9, 10, size / 2, size / 2, i / 15, surf2)
- surf:drawSurfaceRotated(30, 10, size / 2, size / 2, i / 15, surf2)
- surf:fillTriangle(8, 1, math.floor(math.sin(i / 10) * 30 + 3), 19, math.floor(math.sin(i / 10) * 30 + 23), 19, "-", nil, colors.blue)
- draw()
- end
- for i=18,8,-1 do
- display:drawSurfaceScaled(4, 3, 4 + i - 1, 3 + i - 1, mario)
- draw()
- end
- for i=1,200,1 do
- surf:clear(nil, 2 ^ (i % 16))
- for j=1,3,1 do
- for k=1,4,1 do
- local sizex = math.floor(5 + math.sin((i + j * 4 + k - 6) / 5) * 2)
- local sizey = math.floor((5 + math.sin((i + j * 4 + k - 6) / 5) * 2) * 4 / 3)
- local surf2 = surface.create(sizex, sizey)
- surf2:drawSurfaceScaled(1, 1, sizex, sizey, mario)
- surf:drawSurfaceRotated(k * 10 - 5, j * 5, sizex / 2, sizey / 2, (i + j * 4 + k - 6) / -10, surf2)
- end
- end
- draw()
- end
- local surf2 = surface.create(51, 19)
- for i=1,200,1 do
- surf2:clear()
- surf2:drawSurfaceRotated(19, 9, 19, 9, math.sin(i / 10) / 2.5, mworld)
- local x1 = math.floor(9 - math.cos(i / 8) * 9)
- local x2 = x1 + 22
- local y1 = math.floor(5 - math.sin(i / 8) * 6)
- local y2 = y1 + 10
- surf2.overwrite = true
- surf2:fillRect(0, 0, x1, 20)
- surf2:fillRect(0, 0, 39, y1)
- surf2:fillRect(0, y2, x2, 20)
- surf2:fillRect(x2, 0, 39, 20)
- surf2.overwrite = false
- surf:drawSurface(1, 1, mworld)
- surf:fillRect(x1, y1, x2, y2, nil, colors.black)
- surf:drawSurface(1, 1, surf2)
- draw()
- end
- for i=1,100,1 do
- for j=1,19,1 do
- surf:fillRect(1, j, 38, j, nil, 2 ^ math.floor(((i + j) / 5) % 16))
- end
- for j=1,16,1 do
- local x1 = 19 + math.floor(math.cos(i / 10 + j / 16 * math.pi * 2) * 15 + 0.5)
- local y1 = 10 + math.floor(math.sin(i / 10 + j / 16 * math.pi * 2) * 15 + 0.5)
- local x2 = 19 + math.floor(math.cos(i / 10 + (j + 1) / 16 * math.pi * 2) * 15 + 0.5)
- local y2 = 10 + math.floor(math.sin(i / 10 + (j + 1) / 16 * math.pi * 2) * 15 + 0.5)
- surf:fillTriangle(19, 10, x1, y1, x2, y2, nil, 2 ^ (j % 16))
- end
- draw()
- end
- for i=1,100,1 do
- for j=1,19,1 do
- surf:fillRect(1, j, 38, j, nil, 2 ^ math.floor(((i + j + 100) / 5) % 16))
- end
- for j=1,48,1 do
- local x1 = 19 + math.floor(math.cos(i / 10 + j / 48 * math.pi * 2) * 15 + 0.5)
- local y1 = 10 + math.floor(math.sin(i / 10 + j / 48 * math.pi * 2) * 15 + 0.5)
- local x2 = 19 + math.floor(math.cos(i / 10 + (j + 1) / 48 * math.pi * 2) * 15 + 0.5)
- local y2 = 10 + math.floor(math.sin(i / 10 + (j + 1) / 48 * math.pi * 2) * 15 + 0.5)
- surf:fillTriangle(19, 10, x1, y1, x2, y2, nil, 2 ^ (j % 16))
- end
- draw()
- end
- surf:drawSurface(1, 1, trans1)
- draw()
- os.sleep(0.5)
- for i=0,10,1 do
- surf:drawSurface(1, 1, trans2)
- for j=1,19,1 do
- for k=1,38,1 do
- if (k % 10) > i then
- surf:drawPixel(k, j, trans1:getPixel(k, j))
- end
- end
- end
- draw()
- end
- os.sleep(0.2)
- for i=0,10,1 do
- surf:drawSurface(1, 1, trans1)
- for j=1,19,1 do
- for k=1,38,1 do
- if (-k % 10) > i then
- surf:drawPixel(k, j, trans2:getPixel(k, j))
- end
- end
- end
- draw()
- end
- os.sleep(0.2)
- for i=0,10,1 do
- surf:drawSurface(1, 1, trans2)
- for j=1,19,1 do
- for k=1,38,1 do
- if ((k - j) % 10) > i then
- surf:drawPixel(k, j, trans1:getPixel(k, j))
- end
- end
- end
- draw()
- end
- os.sleep(0.2)
- for i=0,10,1 do
- surf:drawSurface(1, 1, trans1)
- for j=1,19,1 do
- for k=1,38,1 do
- if ((k + j) % 10) > i then
- surf:drawPixel(k, j, trans2:getPixel(k, j))
- end
- end
- end
- draw()
- end
- os.sleep(0.2)
- for i=0,10,1 do
- surf:drawSurface(1, 1, trans2)
- for j=1,19,1 do
- for k=1,38,1 do
- if ((k * j) % 10) > i then
- surf:drawPixel(k, j, trans1:getPixel(k, j))
- end
- end
- end
- draw()
- end
- os.sleep(0.2)
- for i=0,10,1 do
- surf:drawSurface(1, 1, trans1)
- for j=1,19,1 do
- for k=1,38,1 do
- if ((k / j) % 10) > i then
- surf:drawPixel(k, j, trans2:getPixel(k, j))
- end
- end
- end
- draw()
- end
- os.sleep(0.2)
- for i=0,10,1 do
- surf:drawSurface(1, 1, trans2)
- for j=1,19,1 do
- for k=1,38,1 do
- if (k % 10) > i and j % 2 == 0 then
- surf:drawPixel(k, j, trans1:getPixel(k, j))
- elseif (-k % 10) > i and j % 2 ~= 0 then
- surf:drawPixel(k, j, trans1:getPixel(k, j))
- end
- end
- end
- draw()
- end
- for i=38,1,-1 do
- local surf2 = surface.create(i, math.floor(i / 2))
- surf2:drawSurfaceScaled(1, 1, i, math.floor(i / 2), trans2)
- surf:drawSurfaceRotated(19, 9, i / 2, i / 4, (38 - i) / 10, surf2)
- draw()
- end
- for i=0,5,1 do
- display:drawLine(26 - i * 2, 9, 26 + i * 2, 9, nil, colors.white)
- display:drawLine(26, 9 - i, 26, 9 + i, nil, colors.white)
- display:drawLine(26 - i * 2, 9 - i, 26 + i * 2, 9 + i, nil, colors.white)
- display:drawLine(26 + i * 2, 9 - i, 26 - i * 2, 9 + i, nil, colors.white)
- draw()
- end
- for i=5,0,-1 do
- display:drawLine(26 - i * 2, 9, 26 + i * 2, 9, nil, colors.white)
- display:drawLine(26, 9 - i, 26, 9 + i, nil, colors.white)
- display:drawLine(26 - i * 2, 9 - i, 26 + i * 2, 9 + i, nil, colors.white)
- display:drawLine(26 + i * 2, 9 - i, 26 - i * 2, 9 + i, nil, colors.white)
- draw()
- end
- local flies = { }
- local surf2 = surface.create(51, 19)
- for i=1,200,1 do
- table.insert(flies, {x = math.random(51), y = 1, color = 2 ^ (math.random(15) - 1)})
- local j = 1
- while j <= #flies do
- local v = flies[j]
- surf2:drawPixel(v.x, v.y, nil, v.color)
- v.y = v.y + 1
- if v.y > 19 then
- table.remove(flies, j)
- j = j - 1
- end
- j = j + 1
- end
- display:drawSurface(1, 1, surf2)
- draw()
- end
- flies = { }
- for i=1,51,1 do
- while true do
- local r = math.random(51)
- if not flies[r] then
- flies[r] = 1
- break
- end
- end
- for j=1,51,1 do
- if flies[j] then
- surf2:drawPixel(j, flies[j], nil, colors.black)
- flies[j] = flies[j] + 1
- end
- end
- display:drawSurface(1, 1, surf2)
- draw()
- end
- while true do
- local cont = false
- for i=1,51,1 do
- if flies[i] <= 19 then
- cont = true
- break
- end
- end
- if not cont then
- break
- end
- for j=1,51,1 do
- if flies[j] then
- surf2:drawPixel(j, flies[j], nil, colors.black)
- flies[j] = flies[j] + 1
- end
- end
- display:drawSurface(1, 1, surf2)
- draw()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement