I received a response to my post from yesterday. It suggested that I use a pool of enemies: instead of constantly creating new ones, when one is destroyed, put it into the pool and reuse it. I gave it a shot, but was still seeing the issue.
Something else he asked was how many items I had on the screen at once. I guessed about 100, but after the pooling didn't help, I decided to print the growth count to the screen.
What I had overlooked was just how quickly spawning four new growths for every existing growth would become unwieldy. Instead of being an issue at about 100, the slow down was starting at about 3000. I don't think that there will ever be a need to have that many items in the real game, so I think it is a non-issue.
Next on the list of things to look at is to re-enable the collision of the growths with the projectiles and then making sure that the growths revert to previous stages first instead of simply being destroyed outright.
Monday, March 8, 2010
Subscribe to: Post Comments (Atom)
Post a Comment