Optimize Game - Destroy, RemoveChild........?

Hi,

I’m trying to optimize my game, and I’m using this.schedule as a timer ( ex: every 3 seconds, instantiate Prefab, Node, etc… So, in my nodes, I have once Sprite / Node reaches destination, I use RemoveChild. Can I use Destroy? And which is more optimized, pros and cons? If I use Destroy, I can’t instantiate? Any suggestions or tips, would be greatly appreciated it…God Bless…

Sincerely,

Sunday

This is a common problem when creating games. I think you should try making an object pool, so you can reuse the objects instead of destroying and instantiating them.

Here is more on the topic .

1 Like

Hi mbu,

Thanks for the info, really appreciated it…Hopefully, the Cocos Creator team can update the Pooling Section of the Cocos Creator documentation…God Bless…

Sincerely,

Sunday