Understanding Families / Groups before buying

Get help using Construct 2

Post » Wed Feb 06, 2013 12:19 am

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
B
6
S
1
Posts: 25
Reputation: 675

Post » Wed Feb 06, 2013 12:26 am

I really don't want to talk you out of buying it, but you could probably do that by just using animation frames.
B
34
S
4
G
8
Posts: 67
Reputation: 5,857

Post » Wed Feb 06, 2013 12:46 am

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 :Dshinkan2013-02-06 00:47:37
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Wed Feb 06, 2013 10:15 pm

@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!
B
6
S
1
Posts: 25
Reputation: 675


Return to How do I....?

Who is online

Users browsing this forum: Vegamon007, Yahoo [Bot] and 24 guests