Advertisement
VGToolBox

Rocket Controls

Oct 20th, 2012
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.07 KB | None | 0 0
  1. side = "back"
  2. mon = peripheral.wrap(side)
  3. mon.clear()
  4. monX, monY = mon.getSize()
  5. centreX = math.floor(monX * 0.5)
  6. centreY = math.floor(monY * 0.5)
  7. loadingText = "."
  8.  
  9. rocket = {}
  10. flame = {}
  11.  
  12. rocket[1] ="  ."
  13. rocket[2] =" / \\"
  14. rocket[3] =" !o!"
  15. rocket[4] =" AAA"
  16. rocket[5] ="/___\\"
  17. flame[1] = "WWWWW"
  18. flame[2] = "MMMMM"
  19. flame[3] = " WWW"
  20. flame[4] = " MMM"
  21. flame[5] = "  W"
  22. flame[6] = "  M"
  23.  
  24. while not colours.test(rs.getBundledInput("left"),colours.white) do
  25.   mon.clear()
  26.   mon.setCursorPos(1,centreY - 1)
  27.   mon.write("Stand-")
  28.   mon.setCursorPos(1,centreY)
  29.   mon.write("by")
  30.   mon.setCursorPos(centreX - math.floor(#loadingText * 0.5),centreY + 1)
  31.   mon.write(loadingText)
  32.   if #loadingText < 3 then
  33.     loadingText = loadingText .. "."
  34.   else
  35.   loadingText = "."
  36.   end
  37.   sleep(1)
  38. end
  39.  
  40. while not colours.test(rs.getBundledInput("left"),colours.combine(colours.white, colours.orange)) do
  41.   mon.clear()
  42.   mon.setCursorPos(1,centreY)
  43.   mon.write("Door")
  44.   mon.setCursorPos(1,centreY+1)
  45.   mon.write("Closed")
  46.   sleep(1)
  47. end
  48.  
  49. for i = monX + 5, centreX, -1 do
  50.   mon.clear()
  51.   mon.setCursorPos(1,centreY - 2)
  52.   mon.write("System")
  53.   mon.setCursorPos(1,centreY - 1)
  54.   mon.write("Ready")
  55.   mon.setCursorPos(1,centreY + 1)
  56.   mon.write("Launch?")
  57.   for j = 1, 5 do
  58.     mon.setCursorPos(i, (monY - 6) + j)
  59.     mon.write(rocket[j])
  60.   end
  61.   sleep(0.5)
  62. end
  63.  
  64. while not colours.test(rs.getBundledInput("left"),colours.combine(colours.orange, colours.white, colours.red)) do
  65.   mon.clear()
  66.   mon.setCursorPos(1,centreY - 2)
  67.   mon.write("System")
  68.   mon.setCursorPos(1,centreY - 1)
  69.   mon.write("Ready")
  70.   mon.setCursorPos(1,centreY + 1)
  71.   mon.write("Launch?")
  72.   for i = 1, 5 do
  73.       mon.setCursorPos(centreX - 1, (monY - 6) + i)
  74.       mon.write(rocket[i])
  75.   end
  76.   sleep(1)
  77. end
  78.  
  79. for i = monY, -10, -1 do
  80.   mon.clear()
  81.   for j = 1, 5 do
  82.     mon.setCursorPos(centreX - 1, (i - 6) + j)
  83.     mon.write(rocket[j])
  84.   end
  85.   for k = 1, 4 do
  86.     mon.setCursorPos(centreX - 1, (i) + k)
  87.     mon.write(flame[(i % 2) + k])
  88.   end
  89.   print("loop "..i)
  90.   sleep(0.5)
  91. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement