Advertisement
Nike622000

Animation

Jan 5th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1.  
  2. monSide = "back"
  3.  
  4. mon = peripheral.wrap(monSide)
  5. mon.setTextScale(2)
  6. xMax,yMax = mon.getSize()
  7.  
  8. function Bdraw(color)
  9.   mon.setBackgroundColor(color)
  10.   for yPos = 1,yMax do
  11.     for xPos = 1,xMax do
  12.       mon.setCursorPos(xPos,yPos)
  13.       mon.write(" ")
  14.     end
  15.   end
  16. end
  17.  
  18. function Animation(xPos,yPos,color)
  19.   mon.setBackgroundColor(color)
  20.   mon.setCursorPos(xPos,yPos)
  21.   mon.write(" ")
  22. end
  23.  
  24. --Wort1
  25. xPos = {}
  26. yPos = {}
  27. --Wort2
  28. xPos2 = {}
  29. yPos2 = {}
  30.  
  31. while true do
  32. Bdraw(colors.red)
  33.  
  34. for Pixel = 1,#xPos do
  35.   Animation(xPos[Pixel],yPos[Pixel],colors.white)
  36.   sleep(0.1)
  37. end
  38.  
  39. for Pixel = 1,#xPos2 do
  40.   Animation(xPos2[Pixel],yPos2[Pixel],colors.white)
  41.   sleep(0.1)
  42. end
  43.  
  44. sleep(10)
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement