added random sounds and some little changes (little as you, little sussy baka)
This commit is contained in:
@@ -1,4 +1,35 @@
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
player:set_physics_override({speed = 2})
|
||||
--player:set_sky({r=0, g=0, b=0}, "plain", {})
|
||||
end)
|
||||
player:set_physics_override({speed = 2})
|
||||
--player:set_sky({r=0, g=0, b=0}, "plain", {})
|
||||
end)
|
||||
|
||||
amogus_general = { }
|
||||
|
||||
---- SOUNDS CONFIGURATION ----
|
||||
sounds_config = {
|
||||
-- format: {sound name, number of sounds to ramdomly choose from}
|
||||
-- so for example if sound name is "test" and the number of sounds is 3, file names that will be randomly chosen are: "test1", "test2", "test3"
|
||||
{"amogus_sound", 3},
|
||||
}
|
||||
|
||||
|
||||
-- randomized amogus sounds
|
||||
function amogus_general.play_random_sound(sound_name, pos, gain, max_hear_distance, pitch)
|
||||
-- get number of sounds from config
|
||||
local number_of_sounds = nil
|
||||
for i = 1, #sounds_config do
|
||||
if sounds_config[i][1] == sound_name then
|
||||
number_of_sounds = sounds_config[i][2]
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
assert(number_of_sounds ~= nil, "amogus_general.play_random_sound: sound with name '"..sound_name.."' is not found in sounds_config in mod amogus_general in init.lua")
|
||||
|
||||
minetest.sound_play(sound_name..math.random(number_of_sounds), {
|
||||
pos = pos,
|
||||
gain = gain,
|
||||
max_hear_distance = max_hear_distance,
|
||||
pitch = pitch
|
||||
})
|
||||
end
|
||||
BIN
mods/amogus_general/sounds/amogus_sound1.ogg
Normal file
BIN
mods/amogus_general/sounds/amogus_sound1.ogg
Normal file
Binary file not shown.
BIN
mods/amogus_general/sounds/amogus_sound2.ogg
Normal file
BIN
mods/amogus_general/sounds/amogus_sound2.ogg
Normal file
Binary file not shown.
BIN
mods/amogus_general/sounds/amogus_sound3.ogg
Normal file
BIN
mods/amogus_general/sounds/amogus_sound3.ogg
Normal file
Binary file not shown.
BIN
mods/amogus_general/sounds/amogus_sound_old.ogg
Normal file
BIN
mods/amogus_general/sounds/amogus_sound_old.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user