mirror of
https://codeberg.org/tenplus1/mob_horse.git
synced 2024-11-15 06:50:18 +01:00
edit on_sound example to use new loudness scale
This commit is contained in:
parent
9f272940f6
commit
12e6d718cb
4
init.lua
4
init.lua
|
@ -225,8 +225,8 @@ mobs:register_mob("mob_horse:horse", {
|
||||||
end,
|
end,
|
||||||
--[[
|
--[[
|
||||||
on_sound = function(self, def)
|
on_sound = function(self, def)
|
||||||
|
-- loudness ranges from (0.0 = cannot hear, to 1.0 = next to sound)
|
||||||
if def.loudness > 0.2 then -- if loud enough make horse jump with fright
|
if def.loudness > 0.8 then -- if loud enough startle horse into jumping
|
||||||
self.object:set_velocity({x=0, y=5, z=0})
|
self.object:set_velocity({x=0, y=5, z=0})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user