mirror of
https://github.com/APercy/automobiles_pck
synced 2025-08-18 02:45:48 +02:00
improved light and sound
This commit is contained in:
parent
75ccb60613
commit
9c9e8e9f72
@ -288,6 +288,7 @@ function automobiles_lib.swap_node(self, pos)
|
||||
minetest.swap_node(target_pos, {name="air"})
|
||||
end
|
||||
end, target_pos)]]--
|
||||
|
||||
return true
|
||||
end
|
||||
return false
|
||||
|
@ -313,7 +313,14 @@ minetest.register_entity("automobiles_motorcycle:motorcycle", {
|
||||
self.lights:set_properties({textures={"automobiles_motorcycle_lights.png",}, glow=32})
|
||||
self.rlights:set_properties({textures={"automobiles_motorcycle_rear_lights_full.png",}, glow=10})
|
||||
end
|
||||
automobiles_lib.put_light(self)
|
||||
|
||||
--turn the light on just when needed to avoid lag
|
||||
local target_pos = self.object:get_pos()
|
||||
target_pos.y = target_pos.y + 2
|
||||
local light_now = minetest.get_node_light(target_pos)
|
||||
if light_now < 12 then
|
||||
automobiles_lib.put_light(self)
|
||||
end
|
||||
else
|
||||
if is_breaking == false then
|
||||
--desligado
|
||||
|
@ -1,7 +1,7 @@
|
||||
--dofile(minetest.get_modpath("automobiles_motorcycle") .. DIR_DELIM .. "buggy_global_definitions.lua")
|
||||
--dofile(minetest.get_modpath("automobiles_motorcycle") .. DIR_DELIM .. "buggy_hud.lua")
|
||||
--dofile(minetest.get_modpath("automobiles_motorcycle") .. DIR_DELIM .. "motorcycle_global_definitions.lua")
|
||||
--dofile(minetest.get_modpath("automobiles_motorcycle") .. DIR_DELIM .. "motorcycle_hud.lua")
|
||||
|
||||
-- destroy the buggy
|
||||
-- destroy the motorcycle
|
||||
function motorcycle.destroy(self, puncher)
|
||||
automobiles_lib.remove_light(self)
|
||||
if self.sound_handle then
|
||||
@ -37,7 +37,7 @@ function motorcycle.destroy(self, puncher)
|
||||
|
||||
pos.y=pos.y+2
|
||||
|
||||
--minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'automobiles_motorcycle:buggy')
|
||||
--minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'automobiles_motorcycle:motorcycle')
|
||||
minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'automobiles_lib:engine')
|
||||
minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'automobiles_motorcycle:wheel')
|
||||
minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'automobiles_motorcycle:wheel')
|
||||
@ -57,7 +57,7 @@ function motorcycle.engineSoundPlay(self)
|
||||
--sound
|
||||
if self.sound_handle then minetest.sound_stop(self.sound_handle) end
|
||||
if self.object then
|
||||
self.sound_handle = minetest.sound_play({name = "buggy_engine"},
|
||||
self.sound_handle = minetest.sound_play({name = "motorcycle_engine"},
|
||||
{object = self.object, gain = 8,
|
||||
pitch = 1 + ((self._longit_speed/10)/2),
|
||||
max_hear_distance = 10,
|
||||
|
Loading…
Reference in New Issue
Block a user