fix: respect perspective again on shoot-based maps
This commit is contained in:
parent
97b3bcf80f
commit
c9475e742c
1 changed files with 15 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue