From c9475e742cd1ca6d622e644397f8fae6909567d7 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 28 Dec 2019 15:18:14 +0100 Subject: [PATCH] fix: respect perspective again on shoot-based maps --- .../game/modules/world/actors/parent.lua | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sonic-bluestreak.love/game/modules/world/actors/parent.lua b/sonic-bluestreak.love/game/modules/world/actors/parent.lua index 05c9e09..951c67c 100644 --- a/sonic-bluestreak.love/game/modules/world/actors/parent.lua +++ b/sonic-bluestreak.love/game/modules/world/actors/parent.lua @@ -7,11 +7,24 @@ function Parent:new(world, type, x, y, z, w, h, d, isSolid) end function Parent:draw() - Parent.super.draw(self) - --self:drawMainHitbox() + drawx, drawy, drawz = self.x, self.y, self.z + if (self.world.maptype == "shoot") then + drawx = drawx + math.floor(drawy/2) + end + self:drawStart() + if (self.box ~= nil) then + self.box:draw(drawx, drawy, drawz) + else + local x, y = math.floor(drawx), math.floor(drawy - drawz - self.d + (self.h/2)) + self:drawSprite(x, y) + end + self:drawEnd() end function Parent:drawShadow(x, y) +if (self.world.maptype == "shoot") then + x = x + math.floor(y/2) +end self.assets.images["shadow"]:draw(x-4, y+4) end