Reuse of sprites

Reuse of sprites
0.0 0


I’m wondering if it makes any sense to re-use sprites?
I’m developing a game with infinitively scrolling scene (from top to bottom).
So I have a number of questions.

  1. Does it affect a performance if I don’t make removeFromParent for those sprites that are no longer visible on the screen (does OpenGL spends fps for processing them)?
  2. Will it have any difference in terms of performance if I retain+removeFromParent no longer visible sprites and then add them as child for newly created objects instead of create new sprites for new objects?
  3. Maybe there is another best practices for my situation?


Not definitive but
2. Yes…

I have a flag on my entities (called re-use) and if set, I dont’ remove them but put them into a cache, from where they are retrieved when required.
It is relatively expensive to create a new entity compared to simply adjusting its visibility and position.

as an example, i have background trees. Once off screen they simply enter the cache and are re-used slightly off-screen to the right, as needed. So there may be only 4 trees on an infinite scrolling world.