Particle Pool for JavaScript Game Engines

August 3, 2018 comments 92 Reads

Learn how to implement a very simple object pool to reduce the number of object instantiations and deletions in your simulation. Watch this video tutorial and find out how you can save memory. Object pools come in handy any time a simulation requires many objects to consistently be removed and added to the scene. Rather than letting old objects get garbage collected and instantiating new ones, objects can be stored for reuse to avoid using valuable processing time to clear and reallocate memory. Particle systems are an excellent use case for object pooling.
Source Code:
Working Example:
See more: