From 52243c7d8c8bfb61e3f465ac3b1545fef6715d50 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Mon, 22 Mar 2021 21:14:40 +0100 Subject: [PATCH] fix: add turning handling in parent file --- .../scenes/overworld/actors/parent.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sonic-radiance.love/scenes/overworld/actors/parent.lua b/sonic-radiance.love/scenes/overworld/actors/parent.lua index a40e453..852c14e 100644 --- a/sonic-radiance.love/scenes/overworld/actors/parent.lua +++ b/sonic-radiance.love/scenes/overworld/actors/parent.lua @@ -27,6 +27,7 @@ function Parent:initCharset() self.charDir = "down" self.cantWalk = false self.cantTurn = false + self.isTurning = false end function Parent:setCharset(charset, charId, cantWalk) @@ -40,10 +41,15 @@ function Parent:drawCharset(charset, charId) love.graphics.setColor(1,1,1,0.5) self.assets.images["shadow"]:draw(x + 1, y + 10) utils.graphics.resetColor() - if (self:isMoving() and (not self.cantWalk)) then - self.charsetManager:draw(self.charset, self.charId, self.charDir, x, y - 1) + + if (not self.isTurning) then + if (self:isMoving() and (not self.cantWalk)) then + self.charsetManager:draw(self.charset, self.charId, self.charDir, x, y - 1) + else + self.charsetManager:drawStanding(self.charset, self.charId, self.charDir, x, y - 1) + end else - self.charsetManager:drawStanding(self.charset, self.charId, self.charDir, x, y - 1) + self.charsetManager:drawTurning(self.charset, self.charId, x, y - 1) end end