Advertisement
Guest User

gametest

a guest
Mar 2nd, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. -- var
  2.  
  3. player = "O.o"
  4. plyColor = colors.blue
  5.  
  6. underLayer = colors.black
  7.  
  8. posX = 10
  9. posY = 2
  10.  
  11. lvl1 = paintutils.loadImage("lvl1")
  12.  
  13. function getNextPos()
  14.   -- not now
  15. end
  16.  
  17. while true do
  18.  
  19.   term.clear()
  20.  
  21.   paintutils.drawImage(lvl1,1,1)
  22.  
  23.   term.setBackgroundColor(plyColor)
  24.   term.setCursorPos(posX,posY)
  25.   print(player)
  26.  
  27.   term.setBackgroundColor(underLayer)
  28.  
  29.   local e, key, button = os.pullEvent("key")
  30.  
  31.   if key == 17 then
  32.     posY = posY -1
  33.   end
  34.  
  35.   if key == 31 then
  36.     posY = posY +1
  37.   end
  38.  
  39.   if key == 32 then
  40.     posX = posX +1
  41.   end
  42.  
  43.   if key == 30 then
  44.     posX = posX -1
  45.   end
  46. end
  47.  
  48. -- legend
  49.  
  50. -- 17 = W
  51. -- 32 = D
  52. -- 31 = S
  53. -- 30 = A
  54.  
  55. -- char 7 = wall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement