init audio and hurt sound
This commit is contained in:
parent
59f1227033
commit
28b0384285
BIN
assets/audio/sounds/hurt.mp3
Normal file
BIN
assets/audio/sounds/hurt.mp3
Normal file
Binary file not shown.
0
lib/audio.lua
Normal file
0
lib/audio.lua
Normal file
@ -144,6 +144,7 @@ function attack:cast(caster, target)
|
|||||||
AnimationNode {
|
AnimationNode {
|
||||||
function(node)
|
function(node)
|
||||||
targetSprite:animate("hurt", node)
|
targetSprite:animate("hurt", node)
|
||||||
|
Tree.assets.files.audio.sounds.hurt:play()
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,6 +50,10 @@ function AssetBundle.loadFile(path)
|
|||||||
return love.graphics.newShader(path);
|
return love.graphics.newShader(path);
|
||||||
elseif (ext == "lua") then
|
elseif (ext == "lua") then
|
||||||
return require(string.gsub(path, ".lua", ""))
|
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
|
end
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user