feat: make the fast system accessible easily

This commit is contained in:
Kazhnuz 2021-04-10 12:01:47 +02:00
parent 582008da7d
commit fc1eaa0460

View file

@ -28,6 +28,7 @@ function Parent:initCharset()
self.cantWalk = false
self.cantTurn = false
self.isTurning = false
self.isFast = false
end
function Parent:setCharset(charset, charId, cantWalk)
@ -39,6 +40,7 @@ end
function Parent:drawCharset(charset, charId)
local x, y = utils.math.floorCoord(self.x, self.y)
y = y - 2
local z = math.floor(self.z)
love.graphics.setColor(1,1,1,0.5)
self.assets.images["shadow"]:draw(x + 1, y + 11)
@ -46,12 +48,12 @@ function Parent:drawCharset(charset, charId)
if (not self.isTurning) then
if (self:isMoving() and (not self.cantWalk)) then
self.charsetManager:draw(self.charset, self.charId, self.charDir, x, y)
self.charsetManager:draw(self.charset, self.charId, self.charDir, x, y - z, self.isFast)
else
self.charsetManager:drawStanding(self.charset, self.charId, self.charDir, x, y)
self.charsetManager:drawStanding(self.charset, self.charId, self.charDir, x, y - z, self.isFast)
end
else
self.charsetManager:drawTurning(self.charset, self.charId, x, y)
self.charsetManager:drawTurning(self.charset, self.charId, x, y - z, self.isFast)
end
end