feature/audioengine #26

Manually merged
PeaAshMeter merged 11 commits from feature/audioengine into main 2026-01-18 17:56:13 +03:00
2 changed files with 15 additions and 3 deletions
Showing only changes of commit 70ec74ebe3 - Show all commits

View File

@ -1,6 +1,8 @@
local ease = require "lib.utils.easing"
local AnimationNode = require "lib.animation_node"
--- @alias SourceFilter { type: "bandpass"|"highpass"|"lowpass", volume: number, highgain: number, lowgain: number }
--- @class Audio
--- @field musicVolume number
--- @field soundVolume number
@ -60,7 +62,11 @@ function audio:crossfade(from, to, ms)
end
--- @param source love.Source
function audio:play(source)
--- @param settings SourceFilter?
function audio:play(source, settings)
if settings then
source:setFilter(settings)
end
if source:getType() == "stream" then
source:setLooping(self.looped)
source:setVolume(self.musicVolume)

View File

@ -148,8 +148,14 @@ function attack:cast(caster, target)
function(node)
local audioPath = Tree.assets.files.audio
targetSprite:animate("hurt", node)
-- Tree.assets.files.audio.sounds.hurt:play()
Tree.audio:play(audioPath.sounds.hurt)
--- @type SourceFilter
local settings = {
type = "bandpass",
volume = 1,
highgain = 0.1,
lowgain = 0.1
}
Tree.audio:play(audioPath.sounds.hurt, settings)
end
}
}