summaryrefslogtreecommitdiffhomepage
path: root/not/Hero.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-04-05 19:45:59 +0200
committerAki <nthirtyone@gmail.com>2017-04-05 19:45:59 +0200
commita46bdb0673461a69fe4467f794f0ddaab9449f85 (patch)
tree449481ea8000208a421534c294ecf8791081f9b7 /not/Hero.lua
parent527901f599c79047ab9a12fbc065a93faa8f872e (diff)
downloadroflnauts-a46bdb0673461a69fe4467f794f0ddaab9449f85.zip
roflnauts-a46bdb0673461a69fe4467f794f0ddaab9449f85.tar.gz
roflnauts-a46bdb0673461a69fe4467f794f0ddaab9449f85.tar.bz2
Hero no longer uses controler-related functions/methods
Diffstat (limited to 'not/Hero.lua')
-rw-r--r--not/Hero.lua6
1 files changed, 2 insertions, 4 deletions
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")