Defined in Module impact.entity-pool, inherits from ig.Class


EntityBullet = ig.Entity.extend({
	// ...

// Enable Pooling for this Entity Class!
ig.EntityPool.enableFor( EntityBullet );


ig.EntityPool allows you to easily enable pooling for frequently used types of Entities. The EntityPool is global, you don't have to create it, but just enable it for your Entities.

When reviving an Entity from the Pool, Impact will call the Entity&039;s [/documentation/class-reference/entity#reset|.reset()] method, instead of #init().

Read more in the Entity Pooling Article.


.enableFor( EntityClass )

Augments the given EntityClass with pooling functionality. This should only be called once for each Entity Class for which you want to enable pooling.

.drainPool( classId )

Removes all Entities with the given .classId from the Pool.


ig.EntityPool.drainPool( EntityBullet.classId );


Removes all Entities from the Pool.

This function is automatically called by the Game&039;s #.loadLevel() method, before the new level is loaded.