How do I Not Kill Off All Enemies Simultaneously?

Just started using Construct 2? Post your questions here

Post » Fri Jan 08, 2016 3:29 am

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" ()
B
7
Posts: 67
Reputation: 411

Post » Fri Jan 08, 2016 4:49 am

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.
ImageImageImage
B
71
S
21
G
233
Posts: 3,697
Reputation: 130,370

Post » Fri Jan 08, 2016 12:50 pm

Okay. What does that mean? What's a UID? How do I pass it to the function?
B
7
Posts: 67
Reputation: 411

Post » Fri Jan 08, 2016 1:01 pm

Manual entry UID

Manual entry function-object
(look for the part about parameters)
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jan 08, 2016 6:30 pm

Great! I'll read those now...
I'll be back if I've got more questions!
B
7
Posts: 67
Reputation: 411

Post » Sat Jan 09, 2016 4:20 am

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
B
7
Posts: 67
Reputation: 411


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest