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's .reset() method, instead of init()
.
Read more in the Entity Pooling Article.
Augments the given EntityClass with pooling functionality. This should only be called once for each Entity Class for which you want to enable pooling.
Removes all Entities with the given .classId
from the Pool.
Example:
ig.EntityPool.drainPool( EntityBullet.classId );
Removes all Entities from the Pool.
This function is automatically called by the Game's .loadLevel()
method, before the new level is loaded.