← All Examples

Entity Pooling

P pooled / spawn + destroy C elastic / capped pool sparks per frame

Each spark carries a physics body and a display object. Pooled, the scene builds a spark once and cycles it by deactivation. A spark is amber for the life it was built for and cyan for every reused life afterwards. Press P to run the same fountain by spawning and destroying an entity per shot, and watch entities made climb instead of settling. C caps the pool, so a new spark reclaims the oldest one still in flight.