use sounds
This commit is contained in:
parent
f30a9ff04b
commit
e8ea2ec3c4
10
init.lua
10
init.lua
@ -61,6 +61,7 @@ local dogs = {
|
||||
},
|
||||
}
|
||||
|
||||
local randm = 1
|
||||
for dog,data in pairs(dogs) do
|
||||
local s = data.name or string.lower(string.sub(dog, 1, 1))
|
||||
local name = "dogblocks:dog_"..s
|
||||
@ -88,6 +89,15 @@ for dog,data in pairs(dogs) do
|
||||
tiles = {"dogblocks_dog_"..s..".png"},
|
||||
light_source = 15,
|
||||
groups = {oddly_breakable_by_hand=3,snappy=2,choppy=2},
|
||||
on_punch = function(pos)
|
||||
if math.random(randm) == math.random(2) then
|
||||
--minetest.sound_play({name="dogblocks_"..s, pos=pos})
|
||||
minetest.sound_play({name="dogblocks_whine", pos=pos})
|
||||
randm = randm+1
|
||||
else
|
||||
randm = math.max(randm-1, 1)
|
||||
end
|
||||
end,
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = name.." 6",
|
||||
|
BIN
sounds/dogblocks_whine.ogg
Normal file
BIN
sounds/dogblocks_whine.ogg
Normal file
Binary file not shown.
BIN
sounds/whine.ogg
BIN
sounds/whine.ogg
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user