Enemy Overlap Issue

For questions about using Classic.

Post » Tue Feb 28, 2012 2:16 am

Hey everyone!
I have been working on this seemingly simple problem for a while now.
I have a "pool" sprite that allows the player to swim. When he overlaps the "pool" he will activate the built in Construct "Wave" effect I gave him, and I have to say, it looks pretty cool!

So I wanted to do the same for the enemies. The problem is, when there is one enemy overlapping the water, all of the enemies end up activating the "Wave" effect which is not what I want. How can I make it so that only the enemies who are directly overlapping the pool activate the effect? Thanks in advance. :D
B
5
Posts: 18
Reputation: 386

Post » Tue Feb 28, 2012 3:14 am

I figured it out! ^_^ It was really simple.

I had the events:

+Enemy is overlapping Pool
->Enemy activate Warp Effect
+Else
->Enemy deactivate Warp Effect

What I should have had was

+Enemy is overlapping Pool
->Enemy activate Warp Effect
+Enemy is not overlapping Pool
->Enemy deactivate Warp Effect

So simple lol.Awesomeggs2012-02-28 03:14:36
B
5
Posts: 18
Reputation: 386

Post » Tue Feb 28, 2012 4:48 am

It isn't that simple. I'm glad you found it by yourself. The problem is, that one would think, that logically the first approach should be right.

IF something is so do this ELSE do something else

But that logic breaks, if the event picks something.
Enemy is overlapping Pool <- this picks the enemy-instances that are currently overlapping Pool
Else <-this oviously doesn't pick anything. But in Construct, if no specific instance is picked the action will be performed at ALL instances of the object.

So, good work, that you solved it by yourself.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Tue Feb 28, 2012 6:33 pm

Yeah, I'm glad it ended up working too. Sometimes it would pick three or four. Other times it would pick all of them. The else action ended up being too random for me this time. But, I'm glad I was able to find an easy workaround. Thanks.
B
5
Posts: 18
Reputation: 386


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest