So I’m constantly checking collision detections and whenever an enemy gets killed I remove it from the array I’m iterating over.
This is giving me enmueration mutation exceptions, what is the normal way to solve this?
People talked about making copies of the array, but when I’m iterating over it every fraction of a second that idea seems ridiculous.
I agree with the comment of Till. Do something like that, if
self.enemiesis your original mutable array