fix: add sound to punch and dash
This commit is contained in:
parent
ddcd393d2a
commit
f700eaa8f8
3 changed files with 10 additions and 5 deletions
BIN
sonic-radiance.love/assets/sfx/dash.wav
Normal file
BIN
sonic-radiance.love/assets/sfx/dash.wav
Normal file
Binary file not shown.
|
@ -100,24 +100,28 @@ function PlayerActions:actionSwitch()
|
||||||
end
|
end
|
||||||
|
|
||||||
function PlayerActions:actionRun()
|
function PlayerActions:actionRun()
|
||||||
if self.keys["C"].isDown then
|
if self.keys["C"].isPressed then
|
||||||
if (self:canDoAction("run")) then
|
if (self:canDoAction("run")) then
|
||||||
|
self.assets.sfx["dash"]:play()
|
||||||
if (utils.table.contain({"run", "idle"}, self.currentAction)) then
|
if (utils.table.contain({"run", "idle"}, self.currentAction)) then
|
||||||
self.currentAction = "run"
|
self.currentAction = "run"
|
||||||
elseif (utils.table.contain({"jumpdash", "jump"}, self.currentAction)) then
|
elseif (utils.table.contain({"jumpdash", "jump"}, self.currentAction)) then
|
||||||
self.currentAction = "jumpdash"
|
self.currentAction = "jumpdash"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif (self.currentAction == "run") then
|
elseif (not self.keys["C"].isDown) then
|
||||||
self.currentAction = "idle"
|
if (self.currentAction == "run") then
|
||||||
elseif (self.currentAction == "jumpdash") then
|
self.currentAction = "idle"
|
||||||
self.currentAction = "jump"
|
elseif (self.currentAction == "jumpdash") then
|
||||||
|
self.currentAction = "jump"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function PlayerActions:actionPunch()
|
function PlayerActions:actionPunch()
|
||||||
if self.keys["C"].isPressed then
|
if self.keys["C"].isPressed then
|
||||||
if (self:canDoAction("punch")) then
|
if (self:canDoAction("punch")) then
|
||||||
|
self.assets.sfx["hit"]:play()
|
||||||
self.xsp, self.ysp = utils.math.lengthdir(BASE_SPEED * RUN_FACTOR, math.rad(self.charsetManager.angle[self.charDir]))
|
self.xsp, self.ysp = utils.math.lengthdir(BASE_SPEED * RUN_FACTOR, math.rad(self.charsetManager.angle[self.charDir]))
|
||||||
self.xsp = -self.xsp
|
self.xsp = -self.xsp
|
||||||
self.currentAction = "punch"
|
self.currentAction = "punch"
|
||||||
|
|
|
@ -48,6 +48,7 @@ return {
|
||||||
{"hitconnect", "assets/sfx/hitconnect.wav"},
|
{"hitconnect", "assets/sfx/hitconnect.wav"},
|
||||||
{"jump", "assets/sfx/jump.wav"},
|
{"jump", "assets/sfx/jump.wav"},
|
||||||
{"fly", "assets/sfx/flight.wav"},
|
{"fly", "assets/sfx/flight.wav"},
|
||||||
|
{"dash", "assets/sfx/dash.wav"},
|
||||||
{"woosh", "assets/sfx/woosh.wav"},
|
{"woosh", "assets/sfx/woosh.wav"},
|
||||||
{"spincharge", "assets/sfx/spincharge.wav"},
|
{"spincharge", "assets/sfx/spincharge.wav"},
|
||||||
{"spinrelease", "assets/sfx/spinrelease.wav"},
|
{"spinrelease", "assets/sfx/spinrelease.wav"},
|
||||||
|
|
Loading…
Reference in a new issue