Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Using Strings in a useful way

A topic by Dyrango created Apr 29, 2022 Views: 261 Replies: 2
Viewing posts 1 to 2

A video explaining the title a lot better

(+1)

Be careful! Removing objects from a list shifts all of the items and their indices in it. Doing that while iterating is dangerous for this reason: if you remove object at index i, then whatever was at index i + 1 is now at i. But your loop does i++, skipping it! You must compensate by doing i-- when removing.

I noticed adding i--; to the end of my method it removes every one of my dust particles before re adding another 10. Is there a way to do this by only removing 1 dust particle at a time?