Game Development Reference
In-Depth Information
end
end
local function PruneEvents(events, deltaTimeInMillis)
local validEvents = {};
-- Remove all events when their time-to-live becomes
negative.
for index = 1, #events do
local event = events[index];
event.ttl = event.ttl - deltaTimeInMillis;
if (event.ttl > 0) then
table.insert(validEvents, event);
end
end
return validEvents;
end
Search WWH ::




Custom Search