SHOW:
|
|
- or go back to the newest paste.
| 1 | - | local scr_x, scr_y = term.getSize() |
| 1 | + | screen=peripheral.wrap("top")
|
| 2 | if not screen then | |
| 3 | screen = term.native() | |
| 4 | end | |
| 5 | ||
| 6 | local scr_x, scr_y = screen.getSize() | |
| 7 | ||
| 8 | local doit = function(move) | |
| 9 | if not move then move = 0 end | |
| 10 | local res1,res2 | |
| 11 | - | term.setCursorPos(b,a) |
| 11 | + | |
| 12 | for b = 1, scr_x do | |
| 13 | - | term.blit(" ","7","7")
|
| 13 | + | |
| 14 | local y = a-math.ceil(scr_y/2) | |
| 15 | - | term.write(" ")
|
| 15 | + | |
| 16 | screen.setCursorPos(b,a) | |
| 17 | if res1 then | |
| 18 | - | term.setCursorPos(b,a) |
| 18 | + | screen.blit(" ","7","7")
|
| 19 | else | |
| 20 | - | term.blit(" ","8","8")
|
| 20 | + | screen.write(" ")
|
| 21 | end | |
| 22 | res2 = math.abs( math.floor(math.cos((x/4)+(move*4))*3) - y+2 ) <= 1 | |
| 23 | screen.setCursorPos(b,a) | |
| 24 | - | term.blit("|","7","f")
|
| 24 | + | |
| 25 | screen.blit(" ","8","8")
| |
| 26 | - | term.write(" ")
|
| 26 | + | |
| 27 | if not res1 then | |
| 28 | if (x % 2 == 0) and ((y+math.floor(move*-10)+(x % 5)) % 5 <= 1) then | |
| 29 | screen.blit("|","7","f")
| |
| 30 | else | |
| 31 | screen.write(" ")
| |
| 32 | end | |
| 33 | end | |
| 34 | end | |
| 35 | end | |
| 36 | - | --term.clear() |
| 36 | + | |
| 37 | end | |
| 38 | ||
| 39 | while true do | |
| 40 | for a = 1, 900 do | |
| 41 | --screen.clear() | |
| 42 | doit(a/10) | |
| 43 | event, param = os.pullEvent() | |
| 44 | if event == "char" or | |
| 45 | event == "key" or | |
| 46 | event == "paste" or | |
| 47 | event == "mouse_click" or | |
| 48 | event == "mouse_drag" or | |
| 49 | event == "mouse_up" or | |
| 50 | event == "mouse_scroll" or | |
| 51 | then | |
| 52 | system | |
| 53 | sleep(0.05) | |
| 54 | end | |
| 55 | end |