Sign in to follow this  
game-dev-monkey

Groups, layering, and pool management

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. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.