Skip to content

Commit 71792ba

Browse files
added sound on shoot
1 parent f633baf commit 71792ba

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

readme.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
# Attributions
3+
4+
5+
* sounds/spacecannon_shoot.ogg https://freesound.org/people/jonccox/sounds/175261/

sounds/spacecannon_shoot.ogg

15.4 KB
Binary file not shown.

util.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ end
77

88
spacecannon.fire = function(pos, color, speed, range)
99

10-
1110
if has_warzone_mod then
1211
-- check warzone height
1312
local min_y = warzone.y_start
@@ -32,6 +31,11 @@ spacecannon.fire = function(pos, color, speed, range)
3231
meta:set_int("powerstorage", 0)
3332
end
3433

34+
minetest.sound_play("spacecannon_shoot", {
35+
pos = pos,
36+
gain = 1.0,
37+
max_hear_distance = 16
38+
})
3539

3640
local node = minetest.get_node(pos)
3741
local dir = spacecannon.facedir_to_down_dir(node.param2)

0 commit comments

Comments
 (0)