Jump to content

Groups, layering, and pool management


game-dev-monkey
 Share

Recommended Posts

I have a group of clouds and from what I understand groups work like sprite pools, but also their creation order specifies the render order in the scene.

I have 4 groups that I use for layering :

backgroundLayer

playerLayer

foregroundLayer

UILayer

 

I have a cloud group that has my clouds an it's currently a child of my backgroundLayer so the clouds get rendered behind the player.

The issue is that is some situations I want to have clouds in foregroundLayer.  

what is the best way to handle this?  

1---> Should I have two groups of clouds, one for each layer? 

2---> Or should I have one cloud group and add a cloud to the appropriate layer when needed and then when killing it move it back to the cloud group so that it's back in the pool I am spawning from?

#2 seems messier, but only requires one cloud group. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...