diff options
author | Och Noe <och_noe@forksworld.de> | 2020-02-25 13:55:47 +0100 |
---|---|---|
committer | Och Noe <och_noe@forksworld.de> | 2020-02-25 13:55:47 +0100 |
commit | 41be2310324784e7de2fbb2c4e0c18858615c006 (patch) | |
tree | 02f9ad522e9574988acaef9a2d8b4261685ce3d3 | |
parent | ff355e45f6e325fe32c044ca22b258ed0eab22e0 (diff) | |
download | elevator-41be2310324784e7de2fbb2c4e0c18858615c006.tar.gz elevator-41be2310324784e7de2fbb2c4e0c18858615c006.tar.bz2 elevator-41be2310324784e7de2fbb2c4e0c18858615c006.zip |
Speed and distance to brake before target now in constants
-rw-r--r-- | init.lua | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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<SLOW_DIST) then + speed = SLOW_SPEED end -- Set the speed. |