summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-04-04 00:45:09 +0100
committerubq323 <ubq323@ubq323.website>2024-04-04 00:45:09 +0100
commitcad220d2551e746255287644f6017276a9a805bf (patch)
tree3ce1a3c260b7a60e9cc26e321d04b4ca73f391f8
parentfa84db80b41e89b35aefeefc60670bb7c0cf3875 (diff)
launch cactus
-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