Guest User

Untitled

a guest
Jan 11th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.80 KB | None | 0 0
  1. t_gameArea = {
  2.     {text = "|---------------------------------------|", colour = colours.lightBlue, xPos = 1, yPos = 1},
  3.     {text = "|                                       |", colour = colours.lightBlue, xPos = 1, yPos = 2},
  4.     {text = "|                                       |", colour = colours.lightBlue, xPos = 1, yPos = 3},
  5.     {text = "|                                       |", colour = colours.lightBlue, xPos = 1, yPos = 4},
  6.     {text = "|                                       |", colour = colours.lightBlue, xPos = 1, yPos = 5},
  7.     {text = "|---------------------------------------|", colour = colours.lightBlue, xPos = 1, yPos = 6},
  8. }
  9.  
  10. t_gameWalls = {
  11.     -- Top left block
  12.     {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},
  13.     {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},
  14.     -- Second Top left block
  15.     {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},
  16.     {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},
  17.     -- Top middle wall
  18.     {x = 21, y = 2}, {x = 21, y = 3}, {x = 21, y = 4}, {x = 21, y = 5},
  19.     -- Second Top Right block
  20.     {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},
  21.     {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},
  22.     -- Top Right block
  23.     {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},
  24.     {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},
  25. }
  26.  
  27. t_gameDots = {}
  28.  
  29. term.setCursorPos(1,1)
  30. term.setBackgroundColour(colours.black)
  31. term.setTextColour(colours.white)
  32. term.clear()
  33.  
  34. for i = 1, #t_gameArea do
  35.     term.setCursorPos(t_gameArea[i].xPos, t_gameArea[i].yPos)
  36.     term.setTextColour(t_gameArea[i].colour)
  37.     write(t_gameArea[i].text)
  38. end
  39.  
  40. -- Draw all the walls
  41. term.setBackgroundColour(colours.red)
  42. for i = 1, #t_gameWalls do
  43.     term.setCursorPos(t_gameWalls[i].x, t_gameWalls[i].y)
  44.     write(' ')
  45. end
  46. term.setBackgroundColour(colours.black)
  47.  
  48. term.setTextColour(colours.yellow)
  49. for sx = 2, 40 do
  50.     for sy = 2, 5 do
  51.         for i = 1, #t_gameWalls do
  52.             if sx == t_gameWalls[i].x and sy == t_gameWalls[i].y then
  53.                 table.insert(t_gameDots, {x = sx, y = sy, eatan = false})
  54.                 break
  55.             end
  56.         end
  57.     end
  58. end
  59.  
  60. -- Draw all the dots
  61. for i = 1, #t_gameDots do
  62.     term.setCursorPos(t_gameDots[i].x, t_gameDots[i].y)
  63.     write('*')
  64. end
  65.  
  66. while true do sleep(5) end
Advertisement
Add Comment
Please, Sign In to add comment