How do I make a bullet NOT destroy multiple sprites ?

Get help using Construct 2

Post » Fri Nov 11, 2016 7:07 pm

Hi !

I am very, very new to this software. My only experience with game making softwares was using The Games Factory about 15 years ago. So, sorry if I post dumb questions !

I am making a turret defense game with the free version of construct, and will most likely buy the full version soon.

I have placed my first turret and my first critters, and when testing collisions, my bullets destroys every single critter it collides with, even if it collides with multiples critters at the same time.

I would like the bullet to destroy only one single critter at a time. I tried to swap on collision with overlapping, I tried to put both of them in the same event condition, I tried to play with collision boxes (1px => 3px => 5px for bullet and only the middle of the critter into the full rectangle being the collision)

At the moment, critters are not supposed to overlap anyway, but it will happen very soon, so I would like to fix this issue now.

How can I make my bullet destroy only one sprite at a time when it collides with more than one at the same time ?

Thank you very much.
B
12
S
4
G
1
Posts: 39
Reputation: 1,378

Post » Fri Nov 11, 2016 7:55 pm

solution found :

"A simple trick is to set the bullet to be invisible on the collision, and also add a check for visibility to the 'On collision' check. Since only the first target checked will have the bullet still visible, only one is eliminated."
B
12
S
4
G
1
Posts: 39
Reputation: 1,378

Post » Fri Nov 11, 2016 9:42 pm

I suppose the bullet gets destroyed on collision.

Then just ...

'Bullet' On collision with 'Sprite'
'Sprite' pick top
...... 'Sprite' destroy
...... 'Bullet' destroy
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sat Nov 12, 2016 2:44 am

Absolutely. Thank you for your reply :)
B
12
S
4
G
1
Posts: 39
Reputation: 1,378


Return to How do I....?

Who is online

Users browsing this forum: Kin, mickclarke, mikehive, tinhofiel, totoe, TRMG and 45 guests