Understanding Families / Groups before buying

0 favourites
  • 4 posts
  • I am very close to making my C2 purchase. I want to ask a few questions about how families work.

    I am currently using the same block sprite with different skins I need these blocks to have the same set of behaviors and actions I want to confirm that I can do that with families. Thanks

  • I really don't want to talk you out of buying it, but you could probably do that by just using animation frames.

  • Yes.

    Basically families are like groups of same objects type (families of sprites, families of text objects etc).

    If you create a family for sprite objects (not sure if there's a limit of attached objects) you can then set a variable for your family (not sprite but family itself) and all members of that family will inherit this variables.

    For example

    Create Family - "my_objects" with family members: sprite1, sprite2, sprite3, sprite4

    Set family number variable "health" = 0

    this means that every member of family "my_object" will have number variable called "health" = 0.

    And here comes the best part. You can set this variable independently for each member and they will keep track of it's own value.

    Sprite1.health = 2

    Sprite3.health = 4

    etc

    If you set your actions to something like:

    +On left mouse button clicked on "my_objects" - > subtract 1 from "health"

    then if you clicked on Sprite1, -1 will be subtracted only from this object.

    Same goes with behaviors.

    Families, containers and functions are your best friends :D

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • gazoogle I am talking about having thousands of objects, so I really can't do it with animation frames.

    shinkan thats EXACTLY what I was wondering. Appreciate everyones feedback!

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