How do I cycle through objects in a Family?

0 favourites
  • 3 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • Hey all!

    I'm making a character creator and have several Families for the different pieces. For example, a Hair Family that contains all the hairstyle objects.

    Is it possible to cycle through all the objects/children within a Family for display/selection purposes? Like "If Player presses the Hair button, the first Hair Child in Family is created. If they press it again, the first child is destroyed and the 2nd child is created" etc.

  • I don't think it's possible without creating some kind of list of all family members - for example in an array.

    You can manually put all hair sprites on the layout (somewhere off-screen). And instead of creating/deleting them move them to the screen and back.

    Another option is to combine all hair animations into a single sprite.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you for the reply!

    I think I'll just put most of the hair into one sprite (working with 16x16 sprites so it shouldn't be too taxing). I don't really understand how arrays work so I'll do it this way instead.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)