Simple question about families

Get help using Construct 2

Post » Fri Jun 08, 2012 9:22 am

Greetings!

I'm working on a shoot'em up. I'd like to understand how families function works (I can't use them with the free version). I just used it a little bit on Construct Classic.

In my shoot'em up, I have several different enemies. They all have a similar HP variable.

I put these enemies into the "enemy" family.

Now, my spaceship is shooting at them. Is it possible to only apply single events to the [enemy] family instead of events for each enemy ship?

Like : "if my laser hits an [enemy], then it decreases the [enemy].HP. If the [enemy].HP <=0, then the [enemy] disappears and create an explosion sprite."

So I don't have to create individual events for each enemy.

Does the families work like this?Canapin2012-06-08 09:58:07
B
5
S
1
Posts: 34
Reputation: 1,026

Post » Fri Jun 08, 2012 1:44 pm

Yep, that's what they do. You just need to pick the family icon when making the event.

Note in Construct 2 family instance variables work a little differently to Classic. In CC you would add the variable to each and every object in the family. In C2 you just add it once to the family itself, and all the objects inherit that variable, which is a little easier and more intuitive to set up.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Fri Jun 08, 2012 2:40 pm

Thank you, dear sir.
B
5
S
1
Posts: 34
Reputation: 1,026


Return to How do I....?

Who is online

Users browsing this forum: kingpirux, Magistross and 2 guests