Jump to content

Sprite body parts - add as sprite children or to a group?


Mike018
 Share

Recommended Posts

When I started modularizing all my sprites into classes (ES6), I would create a group per object and put all the body parts into that group. After dealing with the annoyance of when the group needs have input enabled or needed to be dragged, as well as it just not making logical sense of 1 object being a 'group', I'm thinking about changing all 1 object classes to extend Phaser.Sprite instead and adding them as children.

I'm wondering what everyone else does? It seems that this way will be a lot more flexible since you don't have to deal with all the subtleties of interacting with a group

Link to comment
Share on other sites

ive been thinking of groups as layers in the game. like a background group, ground group, objects group, character group, etc. my sprites are individual things or things that have something that belongs to them. like a tree or a guy with a gun. in that case the guy would be a sprite with a child item for the gun. then i can add tile sprites to ground group and player and monsters to character group and position the character in front of the ground.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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