From eed0553c2f005c439a028d56d82756828e75c2ac Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 3 Apr 2017 19:38:59 +0200 Subject: Hero use direct parent's update rather than distant relative's one --- not/Hero.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/not/Hero.lua b/not/Hero.lua index e81f10c..f77e5cb 100644 --- a/not/Hero.lua +++ b/not/Hero.lua @@ -52,7 +52,7 @@ end -- Initializator of `Hero`. function Hero:init (name, world, x, y) - -- Find imagePath basing on hero name and call super initializator. + -- Find imagePath based on hero name. local fileName = name or Hero.name -- INITIAL from metatable local imagePath = string.format("assets/nauts/%s.png", fileName) -- `PhysicalBody` initialization. @@ -87,6 +87,7 @@ end function Hero:update (dt) -- hotfix? for destroyed bodies if self.body:isDestroyed() then return end + PhysicalBody.update(self, dt) -- locals local x, y = self.body:getLinearVelocity() local isDown = Controller.isDown @@ -143,8 +144,6 @@ function Hero:update (dt) end end - Sprite.update(self, dt) - -- # DEATH -- We all die in the end. local m = self.world.map -- cgit v1.1