fix: fix mirroring

This commit is contained in:
Kazhnuz 2021-04-10 14:26:10 +02:00
parent 6569cb0dd7
commit cb50b7f256

View file

@ -83,7 +83,7 @@ function Charset:draw(charsetName, charID, direction, frame, x, y, isMirrored)
local drawable = self:getTexture(charsetName) local drawable = self:getTexture(charsetName)
local quad = self:getQuad(frame, charID, direction) local quad = self:getQuad(frame, charID, direction)
local sx = 1 local sx = 1
if (isMirrored == false) then if (isMirrored == true) then
sx = -1 sx = -1
end end
love.graphics.draw(drawable, quad, math.floor(x) + 8, math.floor(y), 0, sx, 1, 19, 32) love.graphics.draw(drawable, quad, math.floor(x) + 8, math.floor(y), 0, sx, 1, 19, 32)
@ -106,7 +106,7 @@ function Charset:drawLargeAnim(charsetName, charID, direction, x, y, isFast)
frame = animation[i] frame = animation[i]
end end
end end
if (direction == "right") then if (direction == "left") then
isMirrored = true isMirrored = true
end end
self:drawTurning(charsetName, charID, x, y, isFast, frame, isMirrored) self:drawTurning(charsetName, charID, x, y, isFast, frame, isMirrored)