Killing one enemy from a group of duplicates

For questions about using Classic.

Post » Tue Apr 05, 2016 3:27 am

Message: Ebriosus can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
Hi,

This is my first time here on the forums, so please excuse me if I'm not posting according to community standards.

I'm having a problem with my game where I have duplicates of one type of enemy in one layout, but when the player kills one of the copies, all of them get destroyed. There are also different types of enemies in the game, and they're all under one Family called 'Enemies'.

I actually found a thread on the forum that shows exactly what my problem is and people showing solutions:
https://www.scirra.com/forum/how-do-i-not-kill-off-all-enemies-simultaneously_t166619
Replies to the OP suggest manipulating the unique ID of the enemies, but I'm not sure how you go about this on CC. The most useful answer (which ultimately came from the OP) is a YouTube tutorial video, but it's unfortunately only applicable to Construct 2. Here's the video that the OP linked in his thread:
https://youtu.be/KN_QXfiHVbw?t=8m

Just wondering if there is any way I can replicate what that video tutorial did with the enemy UIDs, but in CC.

Thanks!
B
7
S
3
G
2
Posts: 7
Reputation: 1,589

Post » Wed Apr 06, 2016 2:21 am

Nevermind, I was able to find the solution through trial and error. Thanks to anyone that was looking into this.
B
7
S
3
G
2
Posts: 7
Reputation: 1,589

Post » Wed Jul 20, 2016 10:41 pm

You are too complicated mate. Try to find and learn something about object picking in construct and how it works:
In this case:
>If bullet.object collides with enemy.object
then {destory enemy.object}
The only enemy.object that will be destroyed is the one that its collision has been taken into acount. In other words, despite you have 5 same enemy.objects in the layout, the bullet will only destroy the one enemy it hits
B
5
S
1
Posts: 28
Reputation: 433


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests