diff --git a/sonic-radiance.love/assets/sfx/dash.wav b/sonic-radiance.love/assets/sfx/dash.wav new file mode 100644 index 0000000..0859906 Binary files /dev/null and b/sonic-radiance.love/assets/sfx/dash.wav differ diff --git a/sonic-radiance.love/scenes/overworld/actors/player/actions.lua b/sonic-radiance.love/scenes/overworld/actors/player/actions.lua index ef1d385..69af0fa 100644 --- a/sonic-radiance.love/scenes/overworld/actors/player/actions.lua +++ b/sonic-radiance.love/scenes/overworld/actors/player/actions.lua @@ -100,24 +100,28 @@ function PlayerActions:actionSwitch() end function PlayerActions:actionRun() - if self.keys["C"].isDown then + if self.keys["C"].isPressed then if (self:canDoAction("run")) then + self.assets.sfx["dash"]:play() if (utils.table.contain({"run", "idle"}, self.currentAction)) then self.currentAction = "run" elseif (utils.table.contain({"jumpdash", "jump"}, self.currentAction)) then self.currentAction = "jumpdash" end end - elseif (self.currentAction == "run") then - self.currentAction = "idle" - elseif (self.currentAction == "jumpdash") then - self.currentAction = "jump" + elseif (not self.keys["C"].isDown) then + if (self.currentAction == "run") then + self.currentAction = "idle" + elseif (self.currentAction == "jumpdash") then + self.currentAction = "jump" + end end end function PlayerActions:actionPunch() if self.keys["C"].isPressed 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.xsp self.currentAction = "punch" diff --git a/sonic-radiance.love/scenes/overworld/assets.lua b/sonic-radiance.love/scenes/overworld/assets.lua index 29d1f0b..9158537 100644 --- a/sonic-radiance.love/scenes/overworld/assets.lua +++ b/sonic-radiance.love/scenes/overworld/assets.lua @@ -48,6 +48,7 @@ return { {"hitconnect", "assets/sfx/hitconnect.wav"}, {"jump", "assets/sfx/jump.wav"}, {"fly", "assets/sfx/flight.wav"}, + {"dash", "assets/sfx/dash.wav"}, {"woosh", "assets/sfx/woosh.wav"}, {"spincharge", "assets/sfx/spincharge.wav"}, {"spinrelease", "assets/sfx/spinrelease.wav"},