Page 1 of 1

How do I Not Kill Off All Enemies Simultaneously?

PostPosted: Fri Jan 08, 2016 3:29 am
by Milanbaudelaire
I just learned about Families, so of course I make everything possible into its own separate Family.

I made a Family for enemy sprites, aptly named Enemies, since most of their actions and stats are going to be the same throughout the game. Each enemy sprite has it's own event sheet (that feeds into a main event sheet) for the specifics, like their attacks.

Currently I have just one enemy, Enemy A. I duplicated it and set it at different locations of the layout. Interestingly, when I defeat the first one, the copy gets defeated too! How can I make sure that when I defeat one enemy, they don't all come down like bowling pins? Should I add a condition to the Family, or to Enemy A's specific event sheet?

Currently:

System | For each Enemies
>Enemies | Health less than or equal to 0 | Function: Call "Defeated" ()

Re: How do I Not Kill Off All Enemies Simultaneously?

PostPosted: Fri Jan 08, 2016 4:49 am
by blackhornet
You need to pass the UID of the 'Enemies' to the function and pick it again. By default all Enemies will be picked in the function.

Re: How do I Not Kill Off All Enemies Simultaneously?

PostPosted: Fri Jan 08, 2016 12:50 pm
by Milanbaudelaire
Okay. What does that mean? What's a UID? How do I pass it to the function?

Re: How do I Not Kill Off All Enemies Simultaneously?

PostPosted: Fri Jan 08, 2016 1:01 pm
by LittleStain
Manual entry UID

Manual entry function-object
(look for the part about parameters)

Re: How do I Not Kill Off All Enemies Simultaneously?

PostPosted: Fri Jan 08, 2016 6:30 pm
by Milanbaudelaire
Great! I'll read those now...
I'll be back if I've got more questions!

Re: How do I Not Kill Off All Enemies Simultaneously?

PostPosted: Sat Jan 09, 2016 4:20 am
by Milanbaudelaire
I found the answer in this very helpful YouTube tutorial! The part about not killing off all the enemies at once begins at 8:00...

Construct 2 Tutorial - Super Mario Bros: Koopa Troopa (Part 11):
https://youtu.be/KN_QXfiHVbw?t=8m