fix: add turning handling in parent file

This commit is contained in:
Kazhnuz 2021-03-22 21:14:40 +01:00
parent 2cf4559a81
commit 52243c7d8c

View file

@ -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,11 +41,16 @@ 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 (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:drawTurning(self.charset, self.charId, x, y - 1)
end
end
function Parent:draw()