Detector rail added

Neated the code
This commit is contained in:
number Zero
2015-06-01 21:21:42 +03:00
committed by SmallJoker
parent 79905e47f4
commit adfcfe0841
10 changed files with 85 additions and 0 deletions

View File

@ -13,9 +13,17 @@ function vector.floor(v)
}
end
function vector.tostr(v)
return string.format("{%.3f; %.3f; %.3f}", v.x, v.y, v.z)
end
dofile(boost_cart.modpath.."/functions.lua")
dofile(boost_cart.modpath.."/rails.lua")
if mesecon then
dofile(boost_cart.modpath.."/detector.lua")
end
boost_cart.cart = {
physical = false,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
@ -224,6 +232,10 @@ function boost_cart.cart:on_step(dtime)
new_acc = vector.multiply(dir, acc)
end
if mesecon then
boost_cart:signal_detector_rail(vector.floor(pos))
end
self.object:setacceleration(new_acc)
self.old_pos = vector.new(pos)
self.old_dir = vector.new(dir)