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.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :)
B
17
S
9
G
69
Posts: 1,048
Reputation: 37,659

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
3
Posts: 77
Reputation: 1,101

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
402
S
238
G
89
Posts: 24,637
Reputation: 196,071

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
3
Posts: 77
Reputation: 1,101

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.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :)
B
17
S
9
G
69
Posts: 1,048
Reputation: 37,659

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests