This project has moved and is read-only. For the latest updates, please go here.

Object Pool Best Practices With 3.0

Topics: User Forum
Aug 10, 2011 at 6:38 AM

I'm implementing object pooling with bullets in my game and everything is going fine.  Currently whenever a bullet needs to be "removed" from the game I simply disable it like this:


body.Awake = false;
body.Enabled = false;
pool.Release(this); // Put the bullet back in the pool

I'm wondering, is this the best way to pool objects in Farseer 3? Should I also move objects off screen? Is there anything I'm missing that could make this better?