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

0 favourites
  • 4 posts
  • 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

  • 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.

  • Thats great, many many thanks!

    moymoymoy

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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"

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