Jump to content

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


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

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.

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.


  • Recently Browsing   0 members

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