Advertisement
Ltven0mI

TrackedTurtle

Mar 30th, 2023
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. -- Tracked Turtle
  2.  
  3. local pos = {x=0, y=0, z=0}
  4. local dir = 0
  5.  
  6. local directions = {
  7.   [1]={
  8.     name="north",
  9.     vector={x=0, y=0, z=1}
  10.   },
  11.   [2]={
  12.     name="east",
  13.     vector={x=1, y=0, z=0}
  14.   },
  15.   [3]={
  16.     name="south",
  17.     vector={x=0, y=0, z=-1}
  18.   },
  19.   [4]={
  20.     name="west",
  21.     vector={x=-1, y=0, z=0}
  22.   },
  23. }
  24.  
  25. local function getDirVector(dir)
  26.   return directions[dir].vector
  27. end
  28.  
  29. print("North", getDirVector(1))
  30. print("East", getDirVector(2))
  31. print("South", getDirVector(3))
  32. print("West", getDirVector(4))
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement