improve physics

This commit is contained in:
Alexsandro Percy 2025-05-24 17:43:08 -03:00
parent a000c0aa51
commit 54cc258cca

View file

@ -81,7 +81,13 @@ function ap_airship.physics(self)
self.object:set_velocity(velocity)
end
--minetest.chat_send_all("_baloon_buoyancy: "..self._baloon_buoyancy.." - dtime: "..self.dtime.." - ideal: "..ap_airship.ideal_step)
airutils.set_acceleration(self.object,{x=0,y=y_accel,z=0})
local max_y_speed = 1.5
local curr_y_speed = vel.y
if curr_y_speed < max_y_speed then
airutils.set_acceleration(self.object,{x=0,y=y_accel,z=0})
else
airutils.set_acceleration(self.object,{x=0,y=0,z=0})
end
end