So I added some code to the On A Button Pressed block:
To figure out if one of these was getting completely with sprites and well…
Turns out you need just about 1000 sprites hanging around in an array before the game completely breaks, so that’s neat!
Anyways, like I explained to you in your own topic, sprites do not get removed from arrays when they die. They still exist. You have to remove them yourself! Instead of making your own variable to keep track of them all, simply use the “array of sprites of kind (sun)” block to keep track of them instead:
Sprites do get removed from this block when they die, and once there are no more references to a sprite it gets cleared by the garbage collector and cannot hog up all the memory anymore. So just replace your variable with this one, and don’t forget to remove the block that adds them to that currentSun array!


