tiny-ecs-love-template/systems/decay.lua

6 lines
219 B
Lua

filteredSystem("decay", { decayAfterSeconds = T.number }, function(e, dt, system)
e.decayAfterSeconds = e.decayAfterSeconds - dt
if e.decayAfterSeconds <= 0 then
system.world:removeEntity(e)
end
end)