fix: add turning handling in parent file
This commit is contained in:
parent
2cf4559a81
commit
52243c7d8c
1 changed files with 9 additions and 3 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue