mirror of
https://github.com/pandorabox-io/spacecannon.git
synced 2024-12-21 05:15:47 +01:00
added sound on shoot
This commit is contained in:
parent
f633baffe1
commit
71792ba313
5
readme.md
Normal file
5
readme.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
# Attributions
|
||||||
|
|
||||||
|
|
||||||
|
* sounds/spacecannon_shoot.ogg https://freesound.org/people/jonccox/sounds/175261/
|
BIN
sounds/spacecannon_shoot.ogg
Normal file
BIN
sounds/spacecannon_shoot.ogg
Normal file
Binary file not shown.
6
util.lua
6
util.lua
@ -7,7 +7,6 @@ end
|
|||||||
|
|
||||||
spacecannon.fire = function(pos, color, speed, range)
|
spacecannon.fire = function(pos, color, speed, range)
|
||||||
|
|
||||||
|
|
||||||
if has_warzone_mod then
|
if has_warzone_mod then
|
||||||
-- check warzone height
|
-- check warzone height
|
||||||
local min_y = warzone.y_start
|
local min_y = warzone.y_start
|
||||||
@ -32,6 +31,11 @@ spacecannon.fire = function(pos, color, speed, range)
|
|||||||
meta:set_int("powerstorage", 0)
|
meta:set_int("powerstorage", 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
minetest.sound_play("spacecannon_shoot", {
|
||||||
|
pos = pos,
|
||||||
|
gain = 1.0,
|
||||||
|
max_hear_distance = 16
|
||||||
|
})
|
||||||
|
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local dir = spacecannon.facedir_to_down_dir(node.param2)
|
local dir = spacecannon.facedir_to_down_dir(node.param2)
|
||||||
|
Loading…
Reference in New Issue
Block a user