Allowed for entities to be in multiple systems. Fixed the removal issue.

This commit is contained in:
Justin van der Leij 2018-02-20 23:38:04 +01:00
parent c750ea119f
commit 100d6320c7
5 changed files with 28 additions and 10 deletions

View file

@ -76,13 +76,13 @@ end
function RandomRemover:update(dt)
self.time = self.time + dt
if self.time >= 0.5 then
if self.time >= 0.25 then
self.time = 0
if self.pool.size > 0 then
local i = love.math.random(1, self.pool.size)
Game:removeEntity(self.pool.objects[i])
self.pool:get(i):destroy()
end
end