aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/sound/thud.mp3bin100310 -> 0 bytes
-rw-r--r--res/sound/thud.oggbin0 -> 27684 bytes
-rw-r--r--src/objs/specks.lua3
-rw-r--r--src/objs/tilemap.lua2
-rw-r--r--src/sound.lua5
5 files changed, 5 insertions, 5 deletions
diff --git a/res/sound/thud.mp3 b/res/sound/thud.mp3
deleted file mode 100644
index 1e231e1..0000000
--- a/res/sound/thud.mp3
+++ /dev/null
Binary files differ
diff --git a/res/sound/thud.ogg b/res/sound/thud.ogg
new file mode 100644
index 0000000..16fde7f
--- /dev/null
+++ b/res/sound/thud.ogg
Binary files differ
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