scenes/levels: more wrapper to the bump functions

This commit is contained in:
Kazhnuz 2019-03-03 13:07:12 +01:00
parent ff13de2e3c
commit f65424f265
2 changed files with 9 additions and 1 deletions

View File

@ -117,6 +117,6 @@ end
function Level:getVisibleEntities()
local camx, camy, camw, camh = self:getScreenCoord()
local visibleThings, len = self.world:queryRect(camx-64, camy-64, camw+128, camh+128)
local visibleThings, len = self:queryRect(camx-64, camy-64, camw+128, camh+128)
return visibleThings, len
end

View File

@ -120,6 +120,14 @@ function Level:removeEntity(entity)
return self.world:remove(entity)
end
function Level:queryRect(x, y, w, h)
return self.world:queryRect(x, y, w, h)
end
function Level:countEntities()
return self.world:countItems()
end
function Level:worldUpdate(dt)
--l,t,w,h = l or 0, t or 0, w or self.width, h or self.height
local visibleThings, len = self:getVisibleEntities()