Advertisement
DOGGYWOOF

boot anim

Jan 20th, 2024 (edited)
4
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. local width, height = term.getSize()
  2.  
  3. -- Function to draw the spinning wheel with colors
  4. local function drawWheel(x, y, frame)
  5. local colors = {colors.red, colors.orange, colors.yellow, colors.lime}
  6. local spokes = {"█", "▓", "▒", "░"}
  7. local spinner = spokes[(frame % 4) + 1]
  8.  
  9. term.setCursorPos(x, y)
  10. term.setTextColor(colors[(frame % 4) + 1])
  11. term.setBackgroundColor(colors.black)
  12. term.write(spinner)
  13. end
  14.  
  15. -- Function to clear the screen
  16. local function clearScreen()
  17. term.clear()
  18. term.setCursorPos(1, 1)
  19. end
  20.  
  21. -- Main function to run the fancier animation
  22. local function runFancyAnimation()
  23. local frames = 20 -- Adjust the number of frames as needed
  24. for frame = 1, frames do
  25. clearScreen()
  26. drawWheel(math.floor(width / 2), math.floor(height / 2), frame)
  27. os.sleep(0.1) -- Adjust the sleep duration for desired speed
  28. end
  29. clearScreen()
  30. end
  31.  
  32. -- Set the background color to a nice dark color
  33. term.setBackgroundColor(colors.black)
  34. clearScreen()
  35.  
  36. -- Run the fancier animation
  37. runFancyAnimation()
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement