From 41be2310324784e7de2fbb2c4e0c18858615c006 Mon Sep 17 00:00:00 2001 From: Och Noe Date: Tue, 25 Feb 2020 13:55:47 +0100 Subject: Speed and distance to brake before target now in constants --- init.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 9efd66f..c8e2ef3 100644 --- a/init.lua +++ b/init.lua @@ -2,6 +2,10 @@ local SPEED = 10 -- Acceleration of a box. local ACCEL = 0.1 +-- Distance before target to slow down +local SLOW_DIST = 16 +-- Slow speed before the target +local SLOW_SPEED = 1.75 -- Elevator interface/database version. local VERSION = 8 -- Maximum time a box can go without players nearby. @@ -121,8 +125,8 @@ local function create_box(motorhash, pos, target, sender) -- FIX for "overshooting" local delta_y = math.abs(pos.y-target.y) local speed = SPEED - if (delta_y<10) then - speed = 2 + if (delta_y