feat:add depth based on y position
This commit is contained in:
parent
e22a293f03
commit
3ede8e6654
1 changed files with 6 additions and 0 deletions
|
@ -8,6 +8,12 @@ function Parent:new(world, type, x, y, w, h, isSolid)
|
|||
self.charset = self.world.scene.charsetManager
|
||||
end
|
||||
|
||||
function Parent:update(dt)
|
||||
self.depth = -self.y
|
||||
Parent.super.update(self, dt)
|
||||
self.depth = -self.y
|
||||
end
|
||||
|
||||
function Parent:draw()
|
||||
love.graphics.rectangle("fill", math.floor(self.x), math.floor(self.y), self.w, self.h)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue