There's a few threads about this but I haven't yet found one that works for me. Here's what I need:
1. Enemies cannot overlap each other or the player.
2. Enemies cannot push each other or the player.
3. If two enemies collide, they can still move if the direction they are facing is clear. Otherwise, the enemy should wait.
4. One family of enemies needs to be able to walk through solid walls, like a ghost. The player and other enemies cannot walk through that wall.
My biggest problem is getting a single enemy to stop when two enemies collide. I tried to do this by giving the enemies 8Direction and Solid, but they were pushing each other, and were also clipping through walls at times. Maybe there's a way around this?
What I've settled on for now is using bullet behavior, and giving them a collision in front, where if the collision overlaps another enemy, the collision's container stops. You can see that in the example. I tried to just say "When enemy collides with enemyFamily, stop enemy", but then I can't figure out how I'd get the enemy to move again.
Does anybody have suggestions on a better way to do this?
A secondary question - if you play the capx file, you'll see the enemy jittering. I've found that if I disable the "Set desiredSpeed..." in event 5, then it stops. I have no idea why that actually helps, though. It'll possibly be a moot point if I can get the enemy movement resolved, but it's still strange.
Here's the stripped-down file as an example: dl.dropboxusercontent.com/u/59414921/testEnemyOverlapping.capx
Thanks in advance!