From a46bdb0673461a69fe4467f794f0ddaab9449f85 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 5 Apr 2017 19:45:59 +0200 Subject: Hero no longer uses controler-related functions/methods --- not/Hero.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'not/Hero.lua') diff --git a/not/Hero.lua b/not/Hero.lua index 760a881..6d0a202 100644 --- a/not/Hero.lua +++ b/not/Hero.lua @@ -20,6 +20,7 @@ Hero = { inAir = true, salto = false, isJumping = false, + isWalking = false, jumpTimer = 0.16, jumpCounter = 2, -- Statics @@ -166,12 +167,9 @@ end -- Change animation of `Hero` -- default, walk, attack, attack_up, attack_down, damage function Hero:goToNextFrame () - local isDown = Controller.isDown - local controlset = self:getControlSet() if self.current.repeated or not (self.frame == self.current.frames) then self.frame = (self.frame % self.current.frames) + 1 - elseif isDown(controlset, "right") or isDown(controlset, "left") then - -- If nonrepeatable animation is finished and player is walking + elseif self.isWalking then self:setAnimation("walk") elseif self.current == self.animations.damage then self:setAnimation("default") -- cgit v1.1