use sounds

This commit is contained in:
HybridDog 2014-10-04 15:25:42 +02:00
parent f30a9ff04b
commit e8ea2ec3c4
3 changed files with 10 additions and 0 deletions

View File

@ -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

Binary file not shown.

Binary file not shown.