Advertisement
LDDestroier

CC ROFLcopter

Mar 23rd, 2016
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.20 KB | None | 0 0
  1. rofl = {
  2.     delay = 0.03,
  3.     x = 9,
  4.     y = 7,
  5.     moveRange = 5,
  6.     moveSpeed = 0.1,
  7.     length = 24,
  8.     frame = {
  9.         [1] = {
  10.             "ROFL:ROFL:LOL:",
  11.             "           ^",
  12.             "  L   /----------",
  13.             "  O===          []\\",
  14.             "  L    \\           \\",
  15.             "        \\___________]",
  16.             "           I    I",
  17.             "         ----------/",
  18.         },
  19.         [2] = {
  20.             "         :LOL:ROFL:ROFL",
  21.             "           ^",
  22.             "      /----------",
  23.             " LOL==          []\\",
  24.             "       \\           \\",
  25.             "        \\___________]",
  26.             "           I    I",
  27.             "         ----------/",
  28.         },
  29.     }
  30. }
  31.  
  32.  
  33. local sX,sY = rofl.x,rofl.y
  34. term.setBackgroundColor(colors.white)
  35. term.setTextColor(colors.black)
  36. term.clear()
  37. local frameNo = 0
  38. local clearRofl = function(x,y,tall)
  39.     for a = y, y+tall do
  40.         term.setCursorPos(x,a)
  41.         term.clearLine()
  42.     end
  43. end
  44. while true do
  45.     for a = 1, #rofl.frame do
  46.         clearRofl(rofl.x,rofl.y-1,#rofl.frame[a]+2)
  47.         rofl.x = sX + rofl.moveRange * math.sin(frameNo*rofl.moveSpeed)
  48.         rofl.y = sY + rofl.moveRange * math.cos(frameNo*rofl.moveSpeed)
  49.   for b = 1, #rofl.frame[a] do
  50.          term.setCursorPos(rofl.x,rofl.y+(b-1))
  51.     term.write(rofl.frame[a][b])
  52.   end
  53.         frameNo = frameNo + 1
  54.         sleep(rofl.delay)
  55.     end
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement