pool

namespace pool

a default global ObjectPool instance

// register our bullet object into the object pool
pool.register("bullet", BulletEntity, true);
// ...
// when we need to manually create a new bullet:
let bullet = pool.pull("bullet", x, y, direction, velocity);
// ...
// when we want to destroy existing object, the remove
// function will ensure the object can then be reallocated later
game.world.removeChild(bullet);
See: ObjectPool
Powered by webdoc!