feat(cbs): add sfx playing to choregraphies
This commit is contained in:
parent
851a3d9804
commit
2658a6b54f
5 changed files with 15 additions and 0 deletions
BIN
sonic-radiance.love/assets/sfx/hit.wav
Normal file
BIN
sonic-radiance.love/assets/sfx/hit.wav
Normal file
Binary file not shown.
BIN
sonic-radiance.love/assets/sfx/hitconnect.wav
Normal file
BIN
sonic-radiance.love/assets/sfx/hitconnect.wav
Normal file
Binary file not shown.
|
@ -17,17 +17,25 @@ return {
|
|||
-- if not nil : {ox, oy, shape, size, affectedByDirection}
|
||||
|
||||
choregraphy = { -- the main attack choregraphy
|
||||
{'playSFX', "none", 'hit'},
|
||||
{'setAnimation', "none", 'hit1start', true},
|
||||
{'sendDamage', "none", 33, 100, false, false},
|
||||
{'addGFX',"sentDamage", 'hitGFX', 0.75, 0, true, false},
|
||||
{'playSFX', "sentDamage", 'hitconnect'},
|
||||
{'setAnimation', "none", 'hit1end', true},
|
||||
|
||||
{'playSFX', "none", 'hit'},
|
||||
{'setAnimation', "none", 'hit2start', true},
|
||||
{'sendDamage', "none", 33, 100, false, false},
|
||||
{'addGFX',"sentDamage", 'hitGFX', 0.75, 0, true, false},
|
||||
{'playSFX', "sentDamage", 'hitconnect'},
|
||||
{'setAnimation', "none", 'hit2end', true},
|
||||
|
||||
{'playSFX', "none", 'hit'},
|
||||
{'setAnimation', "none", 'hit3start', true},
|
||||
{'sendDamage', "none", 33, 100, false, false},
|
||||
{'addGFX',"sentDamage", 'hitGFX', 0.75, 0, true, false},
|
||||
{'playSFX', "sentDamage", 'hitconnect'},
|
||||
{'setAnimation', "none", 'hit3end', true},
|
||||
{'setAnimation', "none", 'idle', false},
|
||||
{'wait', "none", 0.5}
|
||||
|
|
|
@ -313,6 +313,9 @@ function Hero:doChoregraphyAction(choregraphyAction)
|
|||
local z = 0
|
||||
|
||||
self.world.obj.GFX(self.world, x + dx, y + dy, z, sprite, self, blockProcess)
|
||||
elseif type == "playSFX" then
|
||||
local sfx = choregraphyAction[3]
|
||||
self.assets.sfx[sfx]:play()
|
||||
else
|
||||
core.debug:warning("cbs/hero", "unknown action type " .. type)
|
||||
end
|
||||
|
|
|
@ -33,5 +33,9 @@ return {
|
|||
["imagefonts"] = {
|
||||
{"hudnbrs", "assets/gui/fonts/hudnumbers"},
|
||||
{"hudnbrs_small", "assets/gui/fonts/hudsmallnumbers"},
|
||||
},
|
||||
["sfx"] = {
|
||||
{"hit", "assets/sfx/hit.wav"},
|
||||
{"hitconnect", "assets/sfx/hitconnect.wav"},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue