MKlegoman357

Move API example foo

Nov 29th, 2020
328
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local move = dofile("move.lua")
  2.  
  3. local function getCurrentPos()
  4.     return move.currentPos, move.currentHeading
  5. end
  6.  
  7. local function printCurrentPos()
  8.     local pos, heading = getCurrentPos()
  9.  
  10.     print("pos:", pos, " heading:", heading)
  11. end
  12.  
  13. printCurrentPos()
  14.  
  15. print("forward:", move:forward(2, true))
  16. printCurrentPos()
  17.  
  18. print("up:", move:up(3, true))
  19. printCurrentPos()
  20.  
  21. sleep(3)
  22.  
  23. print("back:", move:back(2, true))
  24. printCurrentPos()
  25.  
  26. print("turn left:", move:turnLeft(2))
  27. printCurrentPos()
  28.  
  29. print("turn right:", move:turnRight(2))
  30. printCurrentPos()
  31.  
  32. print("down:", move:down(3, true))
  33. printCurrentPos()
RAW Paste Data