mirror of
https://codeberg.org/tenplus1/mob_horse.git
synced 2024-11-14 22:40: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,
|
||||
--[[
|
||||
on_sound = function(self, def)
|
||||
|
||||
if def.loudness > 0.2 then -- if loud enough make horse jump with fright
|
||||
-- loudness ranges from (0.0 = cannot hear, to 1.0 = next to sound)
|
||||
if def.loudness > 0.8 then -- if loud enough startle horse into jumping
|
||||
self.object:set_velocity({x=0, y=5, z=0})
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user