Stop objects from "merging"...?

Get help using Construct 2

Post » Mon Jul 22, 2013 11:09 pm

Hi guys.
I have platformer AI where the characters need to be able to go through each other, but one of the problems I'm facing is that they will bunch of against a wall when cornered by the player because they are trying to run away.

The problem here is that several of them appear to become a single entity and it's very hard to split them apart even if the player leaves and they resume their mostly random movement.

Does anyone know of an easy way to fix this issue? I'm using the platform behavior for their movement.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Tue Jul 23, 2013 12:31 am

You could add the solid behavior to them

Or , you could disable platform behavior when overlapping and re-enable it when not overlapping
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

Post » Tue Jul 23, 2013 1:19 am

[QUOTE=Whiteclaws] You could add the solid behavior to them

Or , you could disable platform behavior when overlapping and re-enable it when not overlapping[/QUOTE]

Thanks for the advice but neither of those really help me.

The objects have to pass through each other because they patrol left and right via platforming. If I disabled the behavior of them when overlapping they would simply stop moving when they passed through each other.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Tue Jul 23, 2013 4:28 pm

You could create an invisible object on each wall (1-pixel bigger than the wall on the side of the enemies ) that , on collision with enemy while they are running away from the player , set the enemies platform disabled , and the wall width is set to wall width + enemy width , and when the player is far enough , set the wall to it's initial width and set the enemies platform enabled

I hope this give you an idea !
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436


Return to How do I....?

Who is online

Users browsing this forum: CJacobsSA, SneakyHands and 6 guests