More of a question than a "how do i" re: families.

Get help using Construct 2

Post » Fri May 02, 2014 11:29 am

Hey all, just a quick question really to confirm if what im thinking is correct. Here goes :)

If i put all my enemies into a family within C2 and then in the event sheet, i say that if a bullet collides with the family, it will take a set amount of hp off of any enemy within that family? If that makes sense?

If im to do this, it would be a big thing to get started on with my project which is why im looking for confirmation instead of diving right in and trying it out.

As always, thanks for the input all :)
Have a great day,
moymoymoy
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Fri May 02, 2014 12:26 pm

yes, that is correct, but you are missing "for each (enemy family)". Without "for each", any bullet hitting any single enemy would damage or kill all enemies. "For Each" gives the specified object (or family object) independence from other instances of same object.
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Fri May 02, 2014 4:01 pm

Thats great, many many thanks! :)

moymoymoy
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Fri May 02, 2014 4:18 pm

@moymoymoy @sgn15 actually you should not use for each, definatly not for collisions, a collision will pick the instances that are in the collision, and also the correct familymember(instance)

if you say on collision family, substract 1 from familyVar "live" (use only familyvars!) only the familymember in the collision will substract 1 from "live"
ImageImage
B
69
S
21
G
7
Posts: 827
Reputation: 10,017


Return to How do I....?

Who is online

Users browsing this forum: ksiads and 2 guests