From fc1eaa0460c8b0394daac8ff78631d00dd6ee823 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 10 Apr 2021 12:01:47 +0200 Subject: [PATCH] feat: make the fast system accessible easily --- sonic-radiance.love/scenes/overworld/actors/parent.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sonic-radiance.love/scenes/overworld/actors/parent.lua b/sonic-radiance.love/scenes/overworld/actors/parent.lua index 95f0710..f808288 100644 --- a/sonic-radiance.love/scenes/overworld/actors/parent.lua +++ b/sonic-radiance.love/scenes/overworld/actors/parent.lua @@ -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