How do I destroy 2 objects at the same time?

Get help using Construct 2

Post » Fri Jan 27, 2017 10:11 pm

Explination

map_enemy.health <= 0 Pick ALL map_enemy with a health lower then zero

For each "map_enemy" Since two can die at the same time. There can be more map_enemy picked. Got to run trough all picked map_enemy's. For each does that job one by one.

"iso_enemy" ... compare instance variabe ... iso_enemy.id = map_enemy.id Lets now add the iso version to the picklist


---- (action): "map_enemy" destroy Actions work on the picked objects only. And we have now picked dead enemys 1 by 1 and their iso versions
--------------- "iso_enemy" destroy


Once you get the hang on picking. Live is easy. I promise. : )
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sat Jan 28, 2017 10:46 am

Thanks for your detailed answers! @99Instances2Go
I feel kind of dumb right now because I still can't get it to work properly. As you said, 1 bullet is destroying multiple enemies sometimes. I tried to create what you wrote in your last post:
https://drive.google.com/open?id=0B7r2W ... U9UTi01TDQ

This is what I had before (it destroys multiple enemies at once):
https://drive.google.com/open?id=0B7r2W ... UxuQmdkRDQ

What I tried to create from your explanation has some issues with invisible enemies.
Here are some more screenshots of the events that could be a cause for this problem:

This is for damaging the enemies with the bullets:
https://drive.google.com/open?id=0B7r2W ... VpjbF95Z1k

This destroys the bullet itself when it hits an enemy:
https://drive.google.com/open?id=0B7r2W ... VpjbF95Z1k

Maybe a capx of my project is a better way to find a solution :) :
Project CAPX
It is a little messy :mrgreen: The Event Sheets where the problems are, are marked with "HERE". Also I left a comment on the exact events.

Thanks for your patience! :)
B
5
S
3
Posts: 197
Reputation: 1,071

Post » Mon Jan 30, 2017 4:48 pm

See if this makes sense to you.

https://www.dropbox.com/s/msh0wzxsa3r7h ... .capx?dl=0

Added a debug view (debug sheet), i needed to see whats happening.
Fixed the map mouse. (map mouse sheet)
Made a strict Die/Mirror/create routine (iso miror sheet)
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Feb 01, 2017 12:09 pm

@99Instances2Go,
Thank you so much for the capx! I will have to look into it for a while to understand everything but I think it will help a lot.
You even fixed some other issues I had with the collision box of the enemies, ... :D
Thanks again! :)
B
5
S
3
Posts: 197
Reputation: 1,071

Previous

Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], Yahoo [Bot] and 33 guests