melonjs
    Preparing search index...

    Namespace pool

    a default global ObjectPool instance pool

    ObjectPool

    // 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);

    Variables

    instance_counter
    objectClass

    Functions

    exists
    getInstanceCount
    poolable
    pull
    purge
    push
    register