1
0
Fork 0

Merge branch 'cart-acceleration' of https://git.minetest.land/2mac/MineClone2 into master

objects
Wuzzy 2020-10-23 22:12:40 +02:00
commit 6b30553707
1 changed files with 9 additions and 6 deletions

View File

@ -414,14 +414,17 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
-- Slow down or speed up -- Slow down or speed up
local acc = dir.y * -1.8 local acc = dir.y * -1.8
local friction = 0.4
local speed_mod = minetest.registered_nodes[minetest.get_node(pos).name]._rail_acceleration local speed_mod = minetest.registered_nodes[minetest.get_node(pos).name]._rail_acceleration
acc = acc - friction
if has_fuel then if has_fuel then
acc = acc + 0.2 acc = acc + 0.6
elseif speed_mod and speed_mod ~= 0 then end
acc = acc + speed_mod
else if speed_mod and speed_mod ~= 0 then
acc = acc - 0.4 acc = acc + speed_mod + friction
end end
new_acc = vector.multiply(dir, acc) new_acc = vector.multiply(dir, acc)