just getting my feet wet with pico-8 even if I've programmed quite extensively over the years. So far I'm having a blast!
Now to the question:
Is it safe to remove elements from a table while traversing it?
foreach(actor,update_actor) ... function update_actor(a) if(a.dead) delete(actor,a) end
Or does the above skip elements?
Other option would be to mark elements for deletion and then make a delete sweep post the update calls.
[Please log in to post a comment]