summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cactus.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/cactus.lua b/cactus.lua
index ae0d77c..f13e35d 100644
--- a/cactus.lua
+++ b/cactus.lua
@@ -78,16 +78,16 @@ end
local function moveby_xz(dv)
if FACING.x ~= 0 then
- move_linear(dv.x)
+ move_linear(dv:dot(FACING))
if dv.z ~= 0 then
- turn_to_face(0,0,numutil.sign(dv.z))
- move_linear(math.abs(dv.z))
+ turn_to_face(vector.new(0,0,numutil.sign(dv.z)))
+ move_linear(dv:dot(FACING))
end
elseif FACING.z ~= 0 then
- move_linear(dv.z)
+ move_linear(dv:dot(FACING))
if dv.x ~= 0 then
- turn_to_face(numutil.sign(dv.x),0,0)
- move_linear(math.abs(dv.x))
+ turn_to_face(vector.new(numutil.sign(dv.x),0,0))
+ move_linear(dv:dot(FACING))
end
end
end