Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t_gameArea = {
- {text = "|---------------------------------------|", colour = colours.lightBlue, xPos = 1, yPos = 1},
- {text = "| |", colour = colours.lightBlue, xPos = 1, yPos = 2},
- {text = "| |", colour = colours.lightBlue, xPos = 1, yPos = 3},
- {text = "| |", colour = colours.lightBlue, xPos = 1, yPos = 4},
- {text = "| |", colour = colours.lightBlue, xPos = 1, yPos = 5},
- {text = "|---------------------------------------|", colour = colours.lightBlue, xPos = 1, yPos = 6},
- }
- t_gameWalls = {
- -- Top left block
- {x = 3, y = 3}, {x = 4, y = 3}, {x = 5, y = 3}, {x = 6, y = 3}, {x = 7, y = 3}, {x = 8, y = 3}, {x = 9, y = 3}, {x = 10, y = 3},
- {x = 3, y = 4}, {x = 4, y = 4}, {x = 5, y = 4}, {x = 6, y = 4}, {x = 7, y = 4}, {x = 8, y = 4}, {x = 9, y = 4}, {x = 10, y = 4},
- -- Second Top left block
- {x = 12, y = 3}, {x = 13, y = 3}, {x = 14, y = 3}, {x = 15, y = 3}, {x = 16, y = 3}, {x = 17, y = 3}, {x = 18, y = 3}, {x = 19, y = 3},
- {x = 12, y = 4}, {x = 13, y = 4}, {x = 14, y = 4}, {x = 15, y = 4}, {x = 16, y = 4}, {x = 17, y = 4}, {x = 18, y = 4}, {x = 19, y = 4},
- -- Top middle wall
- {x = 21, y = 2}, {x = 21, y = 3}, {x = 21, y = 4}, {x = 21, y = 5},
- -- Second Top Right block
- {x = 23, y = 3}, {x = 24, y = 3}, {x = 25, y = 3}, {x = 26, y = 3}, {x = 27, y = 3}, {x = 28, y = 3}, {x = 29, y = 3}, {x = 30, y = 3},
- {x = 23, y = 4}, {x = 24, y = 4}, {x = 25, y = 4}, {x = 26, y = 4}, {x = 27, y = 4}, {x = 28, y = 4}, {x = 29, y = 4}, {x = 30, y = 4},
- -- Top Right block
- {x = 32, y = 3}, {x = 33, y = 3}, {x = 34, y = 3}, {x = 35, y = 3}, {x = 36, y = 3}, {x = 37, y = 3}, {x = 38, y = 3}, {x = 39, y = 3},
- {x = 32, y = 4}, {x = 33, y = 4}, {x = 34, y = 4}, {x = 35, y = 4}, {x = 36, y = 4}, {x = 37, y = 4}, {x = 38, y = 4}, {x = 39, y = 4},
- }
- t_gameDots = {}
- term.setCursorPos(1,1)
- term.setBackgroundColour(colours.black)
- term.setTextColour(colours.white)
- term.clear()
- for i = 1, #t_gameArea do
- term.setCursorPos(t_gameArea[i].xPos, t_gameArea[i].yPos)
- term.setTextColour(t_gameArea[i].colour)
- write(t_gameArea[i].text)
- end
- -- Draw all the walls
- term.setBackgroundColour(colours.red)
- for i = 1, #t_gameWalls do
- term.setCursorPos(t_gameWalls[i].x, t_gameWalls[i].y)
- write(' ')
- end
- term.setBackgroundColour(colours.black)
- term.setTextColour(colours.yellow)
- for sx = 2, 40 do
- for sy = 2, 5 do
- for i = 1, #t_gameWalls do
- if sx == t_gameWalls[i].x and sy == t_gameWalls[i].y then
- table.insert(t_gameDots, {x = sx, y = sy, eatan = false})
- break
- end
- end
- end
- end
- -- Draw all the dots
- for i = 1, #t_gameDots do
- term.setCursorPos(t_gameDots[i].x, t_gameDots[i].y)
- write('*')
- end
- while true do sleep(5) end
Advertisement
Add Comment
Please, Sign In to add comment