I want them to not overlap. So basically, something like, the enemy that is on the left should move one pixel to the left and the one on the right should move one pixel to the right until they are no longer overlapping. I tried to make something like this happen, but the code just didn't work I always just get the sprites try and escape to the same direction. :I
I don't have problem with touching the player since they start an melee attack that stops them from running when they get close enough. But it just looks so silly when I have 3 enemies running and doing the same attack while overlapping with each other.
This is my latest failure:
Sorry if I was unclear in my first post, I don't have a problem with the player overlapping with the enemy I can fix that, but I have a problem with enemy overlapping with another enemy (which is the same sprite).