Collision between a bullet and overlappings enemies ?

Get help using Construct 2

Post » Sun Feb 01, 2015 1:56 pm

Hi.

My character shoots a bullet which collides with an enemy. However, there is another enemy which is overlapping the first one.
Because of that, my event "bullet collision with enemy" is triggered twice instead once. I would like my bullet to hit only one enemy and leave the second one healthy.

I've managed to do this :
overlapping.png

The related events are 17 and 18.

Do you think there is a simpler way ?
You do not have the required permissions to view the files attached to this post.
B
12
S
7
G
7
Posts: 450
Reputation: 4,276

Post » Sun Feb 01, 2015 2:50 pm

Instead of picking nearest you could try picking top/bottom enemy. Under enemy conditions you'll see the pick command at the bottom under the Z order category. See if that helps you.
B
33
S
8
G
2
Posts: 100
Reputation: 2,635

Post » Sun Feb 01, 2015 3:03 pm

Where should I use this? In the event 17 or 18 ?
B
12
S
7
G
7
Posts: 450
Reputation: 4,276

Post » Sun Feb 01, 2015 3:29 pm

Well you could actually combine 17 and 18 into one action. Not sure why you have them separated.
Replace the picknearest with pick top/bottom.
But it all depends on how your game is laid out. This would assume that the enemy that you want to die is always the one on bottom or the top.
Are they different types of enemies. How come you only want one to die?
B
33
S
8
G
2
Posts: 100
Reputation: 2,635

Post » Sun Feb 01, 2015 3:38 pm

I can't do
projectile | On collision with enemy
and
any pick enemy condition

on the same event. My actions will probably use only the enemy returned on the first condition (projectile | On collision with enemy)
B
12
S
7
G
7
Posts: 450
Reputation: 4,276


Return to How do I....?

Who is online

Users browsing this forum: dop2000, Kyatric, warmty and 34 guests