Jump to content
Oliver Hope

Labels Vs Arrays?

Recommended Posts

Hey all

So in my game I am using arrays to keep track of different teams, one array so called thieves and the other security and I can do for each item in array to access them. However I just read a thread where someone reccomend to use labels and now I would like to know which is better.

My question is should I use arrays or labels for teams? What are the pros/cons of each ?

thanks Oliver 

Share this post


Link to post
Share on other sites

Hi, using your own arrays is probably better from performance view. (For each loop over entities from label creates a new array each time you do it)

Labels are "Sets", each entity/game logic can be there only once.

You can use what suits you better. It can be easier to work with labels for someone.

  • Thanks 1

Share this post


Link to post
Share on other sites

Labels have the advantage that you can use them as trigger object or target in Trigger Zones and Listeners.

  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×