aboutsummaryrefslogtreecommitdiff
path: root/advtrains/signals.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2017-12-06 13:23:55 +0100
committerorwell96 <orwell@bleipb.de>2017-12-06 13:23:55 +0100
commitdc67ff7226a2836863a0e709a5b81c90c977f288 (patch)
treed1743a0f59fbc2ed4b4ab8359b1a2bf93c621c6a /advtrains/signals.lua
parentbe8aca9fb8ee406d4728c470a1340be8f418e45f (diff)
downloadadvtrains-dc67ff7226a2836863a0e709a5b81c90c977f288.tar.gz
advtrains-dc67ff7226a2836863a0e709a5b81c90c977f288.tar.bz2
advtrains-dc67ff7226a2836863a0e709a5b81c90c977f288.zip
Implement sound api and some sounds
- Level crossing bell - Horns - Subway train driving and door sounds ...to be continued...
Diffstat (limited to 'advtrains/signals.lua')
-rw-r--r--advtrains/signals.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/advtrains/signals.lua b/advtrains/signals.lua
index 62b9f03..a42f5e7 100644
--- a/advtrains/signals.lua
+++ b/advtrains/signals.lua
@@ -225,3 +225,19 @@ minetest.register_node("advtrains:across_on", {
end
end,
})
+
+minetest.register_abm(
+ {
+ label = "Sound for Level Crossing",
+ nodenames = {"advtrains:across_on"},
+ interval = 3,
+ chance = 1,
+ action = function(pos, node, active_object_count, active_object_count_wider)
+ minetest.sound_play("advtrains_crossing_bell", {
+ pos = pos,
+ gain = 1.0, -- default
+ max_hear_distance = 16, -- default, uses an euclidean metric
+ })
+ end,
+ }
+)