Arcade Sprite Pool


#1

When pooling ordinary sprites you toggle a sprite’s active and visible properties on when the sprite is in use and off when it’s out of use (free).

With physics sprites you’ll also toggle the body.enable property on and off at the same time. It’s convenient to use the enableBody() and disableBody() methods because they can set all 3 properties at once. enableBody() also includes an optional reset which synchronizes the body and game object at a new position.

You can fill a physics group with inactive (free) sprites by passing

{ active: false, visible: false, enable: false }

#2

Thank you !!

I was just looking for this, I was deactivating my sprites but the physics kept updating.
enable/disable body to the rescue =)