Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Trapdoor Visualizer for CC:Tweaked Monitors
- -- Creates a full screen grid that animates satisfying waves
- local mon = peripheral.find("monitor")
- if not mon then
- print("No monitor found!")
- return
- end
- mon.setTextScale(0.5)
- mon.setBackgroundColor(colors.white)
- mon.clear()
- local w, h = mon.getSize()
- -- Each "trapdoor" is a 2x2 block of characters
- local tiles = {}
- -- Build tile map
- local function initTiles()
- for y = 1, h do
- tiles[y] = {}
- for x = 1, w do
- tiles[y][x] = false -- false = closed, true = open/dark
- end
- end
- end
- local function draw()
- for y = 1, h do
- mon.setCursorPos(1, y)
- for x = 1, w do
- if tiles[y][x] then
- mon.setBackgroundColor(colors.gray)
- mon.write(" ")
- else
- mon.setBackgroundColor(colors.lightGray)
- mon.write(" ")
- end
- end
- end
- end
- -- Create a sweeping diagonal wave (like your screenshot)
- local function carveWave()
- local col = math.random(1, w)
- for row = 1, h do
- tiles[row][col] = true
- -- drift left/right
- local r = math.random(3)
- if r == 1 and col > 1 then
Advertisement
Add Comment
Please, Sign In to add comment