diff options
-rw-r--r-- | railcart/init.lua | 3 | ||||
-rw-r--r-- | railcart/railcart.lua | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/railcart/init.lua b/railcart/init.lua index 417b429..c18bc82 100644 --- a/railcart/init.lua +++ b/railcart/init.lua @@ -79,10 +79,11 @@ minetest.register_entity("railcart:cart_entity", { if self.cart and direction then local pos = vector.round(self.object:getpos()) local dir = vector.round(vector.normalize(direction)) + local speed = railcart:velocity_to_speed(self.cart.vel) self.timer = 0 self.cart.target = nil self.cart.prev = pos - self.cart.vel = vector.multiply(dir, 4) + self.cart.vel = vector.multiply(dir, RAILCART_SPEED_PUSH) self.cart.accel = railtrack:get_acceleration(pos) self.object:setvelocity(self.cart.vel) end diff --git a/railcart/railcart.lua b/railcart/railcart.lua index df6d635..bdd9a05 100644 --- a/railcart/railcart.lua +++ b/railcart/railcart.lua @@ -3,8 +3,9 @@ RAILCART_OBJECT_UPDATE_TIME = 5 RAILCART_OBJECT_SAVE_TIME = 10 RAILCART_RELOAD_DISTANCE = 32 RAILCART_SNAP_DISTANCE = 0.5 +RAILCART_SPEED_PUSH = 5 RAILCART_SPEED_MIN = 0.1 -RAILCART_SPEED_MAX = 10 +RAILCART_SPEED_MAX = 20 railcart = { timer = 0, |