diff options
| author | ne_mene <[email protected]> | 2026-03-30 11:31:59 +0200 |
|---|---|---|
| committer | ne_mene <[email protected]> | 2026-03-30 11:31:59 +0200 |
| commit | ccaf23cedd06f2095732d00d5880f8d43ea9bc3f (patch) | |
| tree | 2ca61badae24a66a0c2b46adf8bd2677b5b95aa9 | |
| parent | b7d47f8f297be2a55c9e3508bed40e09d49f1047 (diff) | |
spatial sound?
| -rw-r--r-- | res/sound/thud.mp3 | bin | 100310 -> 0 bytes | |||
| -rw-r--r-- | res/sound/thud.ogg | bin | 0 -> 27684 bytes | |||
| -rw-r--r-- | src/objs/specks.lua | 3 | ||||
| -rw-r--r-- | src/objs/tilemap.lua | 2 | ||||
| -rw-r--r-- | src/sound.lua | 5 |
5 files changed, 5 insertions, 5 deletions
diff --git a/res/sound/thud.mp3 b/res/sound/thud.mp3 Binary files differdeleted file mode 100644 index 1e231e1..0000000 --- a/res/sound/thud.mp3 +++ /dev/null diff --git a/res/sound/thud.ogg b/res/sound/thud.ogg Binary files differnew file mode 100644 index 0000000..16fde7f --- /dev/null +++ b/res/sound/thud.ogg diff --git a/src/objs/specks.lua b/src/objs/specks.lua index dd14a59..16fe021 100644 --- a/src/objs/specks.lua +++ b/src/objs/specks.lua @@ -1,9 +1,6 @@ Speck_Sys = {} Speck_Sys.__index = Speck_Sys - - - local SPAWN_FUNCTIONS = { Rectangle = function (speck_sys) local w = (speck_sys.spawn_width or 0) / 2 diff --git a/src/objs/tilemap.lua b/src/objs/tilemap.lua index 6838d95..96a1247 100644 --- a/src/objs/tilemap.lua +++ b/src/objs/tilemap.lua @@ -146,7 +146,7 @@ end function set_tile(map, x, y, tileid) if map.tiledata[ID(map, x, y)] == 0 then - play_sound("res/sound/thud.mp3") + play_sound("res/sound/thud.ogg") end map.tiledata[ID(map, x, y)] = tileid map.needs_rebuild = true 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 |
