how to destroy bullet when hitting enemy instance?

Get help using Construct 2

Post » Fri Jun 28, 2013 3:45 am

I am stuck on this. I have a square level and on the left side of the map I have spawn points for a enemy_tank. The enemy_tank has a bullet behavior and is spawned every 2 seconds from one of the random spawn points and moves toward the players position when spawned. So sometimes the enemy_tank instances cross paths. After an enemy_tank spawns I have it spawning a bullet_tank from its turret image point. I want the bullet to destroy if it hits another instance of the enemy_tank. My problem is if I set an event for the bullet_tank->destroy on collusion with object->enemy_tank, then it is also just destroys the bullet_tank the second it is spawned because it is firing from the enemy_tank. Is there a way to set up an event to destroy the bullet only when it hits other instances of the enemy_tank?

Here is the capx example, you'll have to copy and paste as i am too new to make links.

https://dl.dropboxusercontent.com/u/688690/exampledestroybullet.capxlazybed2013-06-28 08:03:36
B
9
S
3
G
1
Posts: 14
Reputation: 1,313

Post » Fri Jun 28, 2013 9:31 am

@lazybed

Hi, this should do what you want.

Tank
B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180

Post » Fri Jun 28, 2013 8:34 pm

@spongehammer thank you sir! That is it! I didnt know about setting instance variable id's . Awesome to know, thank you again for the help. I knew there was something I was missing.
B
9
S
3
G
1
Posts: 14
Reputation: 1,313

Post » Fri Jun 28, 2013 10:47 pm

@lazybed

NP
B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], Kyatric, oddreal, oosyrag, waguilar and 2 guests