yeeeeeeeeeeeee

epas

Nov 5th, 2025
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. -- Trapdoor Visualizer for CC:Tweaked Monitors
  2. -- Creates a full screen grid that animates satisfying waves
  3.  
  4. local mon = peripheral.find("monitor")
  5. if not mon then
  6. print("No monitor found!")
  7. return
  8. end
  9.  
  10. mon.setTextScale(0.5)
  11. mon.setBackgroundColor(colors.white)
  12. mon.clear()
  13.  
  14. local w, h = mon.getSize()
  15.  
  16. -- Each "trapdoor" is a 2x2 block of characters
  17. local tiles = {}
  18.  
  19. -- Build tile map
  20. local function initTiles()
  21. for y = 1, h do
  22. tiles[y] = {}
  23. for x = 1, w do
  24. tiles[y][x] = false -- false = closed, true = open/dark
  25. end
  26. end
  27. end
  28.  
  29. local function draw()
  30. for y = 1, h do
  31. mon.setCursorPos(1, y)
  32. for x = 1, w do
  33. if tiles[y][x] then
  34. mon.setBackgroundColor(colors.gray)
  35. mon.write(" ")
  36. else
  37. mon.setBackgroundColor(colors.lightGray)
  38. mon.write(" ")
  39. end
  40. end
  41. end
  42. end
  43.  
  44. -- Create a sweeping diagonal wave (like your screenshot)
  45. local function carveWave()
  46. local col = math.random(1, w)
  47.  
  48. for row = 1, h do
  49. tiles[row][col] = true
  50.  
  51. -- drift left/right
  52. local r = math.random(3)
  53. if r == 1 and col > 1 then
  54.  
Advertisement
Add Comment
Please, Sign In to add comment