How do I get overlapping to detect correctly

Get help using Construct 2

Post » Wed Sep 13, 2017 12:34 pm

You should be able to pick all Enemies by evaluating distance (that formula above=true).
System-> Pick by evaluate or Pick by comparison
It should pick all Enemies in melee range. And then you can do For Each for the picked enemies.
Check out my awesome game Doptrix
B
17
S
8
G
9
Posts: 195
Reputation: 6,379

Post » Wed Sep 13, 2017 1:02 pm

@dop2000 I'll have to experiment with using the pick all by evaluate, and compare it to how I've now got it. See which performance is better.
I've got a demo CAPX (LINK) working with the following code, will now port to my actual game and test performance.
Image

Thanks for all your help.
Image
Keeghan McGarry | Managing Director
Facebook-Website
B
14
S
2
Posts: 61
Reputation: 927

Post » Thu Sep 14, 2017 12:42 pm

Why not just implement the collision flag yourself in a boolean instance variable? Ignore the condition if the boolean is false, and you have a per-instance, per-event way to handle collisions.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Thu Sep 14, 2017 4:55 pm

Because @Ashley, that would be super smart and a simple way to fix my problem.
And I'm not super smart, and always go for the complex methods!

But that is a good idea, I'll look into maybe using that in the future. Particularly if I run into performance issues with this.
Image
Keeghan McGarry | Managing Director
Facebook-Website
B
14
S
2
Posts: 61
Reputation: 927

Post » Fri Sep 15, 2017 4:30 am

:)
Yeah, C2 offers so many different ways to solve each problem that the most efficient and simple one often gets overlooked.
Check out my awesome game Doptrix
B
17
S
8
G
9
Posts: 195
Reputation: 6,379

Previous

Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish and 13 guests