scenes/levels: rename the bump world to "entities"

It'll prepare the naming of the world manager
This commit is contained in:
Kazhnuz 2019-03-03 13:08:54 +01:00
parent f65424f265
commit dcdbae749c
1 changed files with 7 additions and 7 deletions

View File

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