Jump to content

Need some ideas for a name for a new Game Object Group


rich
 Share

Recommended Posts

If this collection is just like a group but its not attached to the display list then surely the name should reflect this?

 

Something like FreeGroup or FloatingGroup.

These names are a little longer than the others which have been suggested but IMHO give a better idea of what it does.

 

Of course the other option is just to stick with the Group class but add an attached property which indicates whether its on the display list or not.

This could make it much easier when you're moving a group of objects from the display list and back. You wouldn't have to convert it to a object type

you'd just call a detach method and away you go.

I could see that this would be an issue because of the existing PIXI group inheritance but this may mean that the inheritance shouldn't have been there and it

should be replaced by some cunning composition / interface rather than making a whole new class.

Link to comment
Share on other sites

I did consider adding a 'not on display list' option to Group, but all of the methods within Group assume that Group children are restricted to being in just one Group at any one time, which isn't the case for what this new class will do.

 

Frustratingly I keep circling back to wanting to rename the current Group to Layer, and then using Group for this new system. But I simply cannot do that in Phaser 2, which now makes me think maybe this feature is best reserved for Phaser 3 anyway, where we do have the luxury of being able to make changes like this.

Link to comment
Share on other sites

If this is still open for discussion, I vote collection. Brevity of variable/methods/structures shouldn't take precedence over clarity. I feel like pool implies a certain level of cermantics.

In terms of functionality, lodash method set is amazing for collections. Curious if it's possible to simply leverage that. The team there seems to pride themselves on speed and staying current.

Link to comment
Share on other sites

  • 2 weeks later...

Bundle and Roster occurred to me, but they both have issues. I think Bundle and Roster are my favorite so far among the words that aren't Pseudo-reserved (i.e. List, Set, Collection). Doing the group/layer reorganization thing is possibly that one that will sound most sensible five years hence, though. =)

 

In my games so far I just keep an array of, say, enemies alongside the group of enemies. I call the nondisplay array "enemies" or "enemiesList" and the group, "enemiesGroup".

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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