One of my favourite lil #gamedev tricks is that if you iterate over your array backwards you can remove elements by swapping with the last element to avoid the need for a second loop or shifting of the array contents!
Post image

Comments