From cad220d2551e746255287644f6017276a9a805bf Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 4 Apr 2024 00:45:09 +0100 Subject: launch cactus --- cactus.lua | 12 ++++++------ 1 file 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 -- cgit v1.2.3