fix: respect perspective again on shoot-based maps

This commit is contained in:
Kazhnuz 2019-12-28 15:18:14 +01:00
parent 97b3bcf80f
commit c9475e742c

View file

@ -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