scenes/levels: rename the bump world to "entities"
It'll prepare the naming of the world manager
This commit is contained in:
parent
f65424f265
commit
dcdbae749c
|
@ -3,7 +3,7 @@ local Obj = require "scenes.levels.entities"
|
|||
function Level:initWorld()
|
||||
self.map = Sti("assets/maps/" .. self.mapfile .. ".lua")
|
||||
self.obj = Obj
|
||||
self.world = Bump.newWorld(50)
|
||||
self.entities = Bump.newWorld(50)
|
||||
self.backcolor = self.map.backgroundcolor or {0, 0, 0}
|
||||
self.blocks = {} -- On vide la liste des blocks
|
||||
|
||||
|
@ -109,23 +109,23 @@ function Level:isCollisionLayer(layername)
|
|||
end
|
||||
|
||||
function Level:addEntity(entity)
|
||||
return self.world:add(entity, entity.x, entity.y, entity.w, entity.h)
|
||||
return self.entities:add(entity, entity.x, entity.y, entity.w, entity.h)
|
||||
end
|
||||
|
||||
function Level:moveEntity(entity, x, y, filter)
|
||||
return self.world:move(entity, x, y, filter)
|
||||
return self.entities:move(entity, x, y, filter)
|
||||
end
|
||||
|
||||
function Level:removeEntity(entity)
|
||||
return self.world:remove(entity)
|
||||
return self.entities:remove(entity)
|
||||
end
|
||||
|
||||
function Level:queryRect(x, y, w, h)
|
||||
return self.world:queryRect(x, y, w, h)
|
||||
return self.entities:queryRect(x, y, w, h)
|
||||
end
|
||||
|
||||
function Level:countEntities()
|
||||
return self.world:countItems()
|
||||
return self.entities:countItems()
|
||||
end
|
||||
|
||||
function Level:worldUpdate(dt)
|
||||
|
@ -155,5 +155,5 @@ function Level:updateMap(dt)
|
|||
end
|
||||
|
||||
function Level:getEntities()
|
||||
return self.world:getItems()
|
||||
return self.entities:getItems()
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue