Compare commits

...

1 Commits

Author SHA1 Message Date
28b0384285 init audio and hurt sound 2025-11-11 16:26:20 +03:00
4 changed files with 5 additions and 0 deletions

Binary file not shown.

0
lib/audio.lua Normal file
View File

View File

@ -144,6 +144,7 @@ function attack:cast(caster, target)
AnimationNode {
function(node)
targetSprite:animate("hurt", node)
Tree.assets.files.audio.sounds.hurt:play()
end
}
}

View File

@ -50,6 +50,10 @@ function AssetBundle.loadFile(path)
return love.graphics.newShader(path);
elseif (ext == "lua") then
return require(string.gsub(path, ".lua", ""))
elseif (ext == "mp3") and string.find(path, "sounds") then
return love.audio.newSource(path, 'static')
elseif (ext == "mp3") and string.find(path, "music") then
return love.audio.newSource(path, 'stream')
end
return nil
end