How to put sprites in an array and use .destroy() for each index

I’ve been struggling with accessing sprites within an array to use the .destroy() function and remove them from the screen.

Whenever I try to use something like myArray[i].destroy() it doesn’t seem to work.

Anyone got any examples?

What doesn’t work?

If you use an array like that, you have to splice the destroyed game object out of the array.

Or you can use a group instead: group.remove(sprite, true, true).