- Home /
pool lists and instantiating...
So I've recently read that when developing games, especially for mobile devices, you want to avoid destroying/instantiating objects as often as possible. Replacing this function with pooling instead.
Now to my understanding, pooling is where every possible enemy/projectile/explosion is already preloaded and simply not visible or off screen, and pooling is where you swap it in and out of the game as needed.
My issue now is that I need to convert allot of code to use this pooling method, but the only examples I can find are in C#. I was hoping someone could either write a short example of how to pool here, or point me towards a java version tutorial/video/documentation.
Thanks
Once again, thanks Rob! Dunno how my google search didn't hit this uestion...
It certainly depends on the game. If you are destroying and instantiating many objects at the same time you will notice a performance hit. If it's one at a time you will probably not notice, taking in the account materials, scripts and anything that is large.
I'm doing a tower defence style game. I can only imagine my trying to instantiate and destroy the man objects on screen at once is going to slow my game to a crawl on a mobile device...