changes on dynamics

master
Alexsandro Percy 2021-12-06 18:29:55 -03:00
parent b6a9f10c48
commit 51b580ab7a
4 changed files with 17 additions and 3 deletions

BIN
sounds/supercub_touch.ogg Normal file

Binary file not shown.

View File

@ -155,7 +155,7 @@ function supercub.control(self, dtime, hull_direction, longit_speed, longit_drag
end
function supercub.set_pitch(self, dir, dtime)
local pitch_factor = 6
local pitch_factor = 5
if dir == -1 then
self._elevator_angle = math.max(self._elevator_angle-pitch_factor*dtime,-supercub.elevator_limit)
elseif dir == 1 then

View File

@ -68,8 +68,8 @@ function supercub.physics(self)
z=new_velocity.z*friction})
else
self.object:set_velocity(new_velocity)
--self.object:set_acceleration(accell)
--self.object:set_velocity(new_velocity)
self.object:set_acceleration(accell)
end
end

View File

@ -307,6 +307,20 @@ function supercub.testImpact(self, velocity, position)
end
end
if impact > 1 then
local noded = mobkit.nodeatpos(mobkit.pos_shift(p,{y=-2.8}))
if (noded and noded.drawtype ~= 'airlike') then
minetest.sound_play("supercub_touch", {
--to_player = self.driver_name,
object = self.object,
max_hear_distance = 15,
gain = 1.0,
fade = 0.0,
pitch = 1.0,
}, true)
end
end
if collision then
--self.object:set_velocity({x=0,y=0,z=0})
local damage = impact / 2