diff options
-rw-r--r-- | not/Hero.lua | 6 | ||||
-rw-r--r-- | not/Player.lua | 10 |
2 files changed, 6 insertions, 10 deletions
diff --git a/not/Hero.lua b/not/Hero.lua index 37e61c0..650eed4 100644 --- a/not/Hero.lua +++ b/not/Hero.lua @@ -169,7 +169,11 @@ end --- Called each time Hero starts walking. -- Is not called when only direction of walking is changed. function Hero:onWalkingStarted () - + if (self.current ~= self.animations.attack) and + (self.current ~= self.animations.attack_up) and + (self.current ~= self.animations.attack_down) then + self:setAnimation("walk") + end end function Hero:onJump () diff --git a/not/Player.lua b/not/Player.lua index 27ace75..c6c4431 100644 --- a/not/Player.lua +++ b/not/Player.lua @@ -42,15 +42,6 @@ function Player:controlpressed (set, action, key) if set ~= self:getControllerSet() then return end self.smoke = false -- TODO: temporary - -- Walking - if (action == "left" or action == "right") then - if (self.current ~= self.animations.attack) and - (self.current ~= self.animations.attack_up) and - (self.current ~= self.animations.attack_down) then - self:setAnimation("walk") - end - end - -- Punching if action == "attack" and self.punchCooldown <= 0 then local f = self.facing @@ -80,6 +71,7 @@ function Player:controlpressed (set, action, key) end end end + function Player:controlreleased (set, action, key) if set ~= self:getControllerSet() then return end -- Jumping |