From ccaf23cedd06f2095732d00d5880f8d43ea9bc3f Mon Sep 17 00:00:00 2001 From: ne_mene Date: Mon, 30 Mar 2026 11:31:59 +0200 Subject: spatial sound? --- src/sound.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/sound.lua') diff --git a/src/sound.lua b/src/sound.lua index 4d31861..6ebe403 100644 --- a/src/sound.lua +++ b/src/sound.lua @@ -16,12 +16,14 @@ function load_sounds_from(path) size = 1, [1] = la.newSource(filepath, "static"), } + sound_bank[filepath][1]:setRelative(true) + sound_bank[filepath][1]:setPosition(0, 0, 0) end end end end -function play_sound(path) +function play_sound(path, x, y) sound = sound_bank[path] local source = nil @@ -35,5 +37,6 @@ function play_sound(path) sound[sound.size] = sound[1]:clone() source = sound[sound.size] end + source:setPosition(x or 0, y or 0, 0) la.play(source) end -- cgit v1.3-2-g0d8e