Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local width, height = term.getSize()
- -- Function to draw the spinning wheel with colors
- local function drawWheel(x, y, frame)
- local colors = {colors.red, colors.orange, colors.yellow, colors.lime}
- local spokes = {"█", "▓", "▒", "░"}
- local spinner = spokes[(frame % 4) + 1]
- term.setCursorPos(x, y)
- term.setTextColor(colors[(frame % 4) + 1])
- term.setBackgroundColor(colors.black)
- term.write(spinner)
- end
- -- Function to clear the screen
- local function clearScreen()
- term.clear()
- term.setCursorPos(1, 1)
- end
- -- Main function to run the fancier animation
- local function runFancyAnimation()
- local frames = 20 -- Adjust the number of frames as needed
- for frame = 1, frames do
- clearScreen()
- drawWheel(math.floor(width / 2), math.floor(height / 2), frame)
- os.sleep(0.1) -- Adjust the sleep duration for desired speed
- end
- clearScreen()
- end
- -- Set the background color to a nice dark color
- term.setBackgroundColor(colors.black)
- clearScreen()
- -- Run the fancier animation
- runFancyAnimation()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement