how to stop enemies from moving to one point when lots of them are chasing one object [duplicate]
- by BBgun
This question already has an answer here:
Is there a simple way to stop enemies standing in the same spot?
8 answers
i am making a top down game which lots of enemies are chasing one guy.
then,enemies would move to one point without any collision,they just overlay each other.
so ,is there any simple way to make them feel more real? make them not overlay with each other?
=================================
i have tried the solution using boundbox to check collision,
but i still very puzzled about what to do with the collision.
i have a bad solution.it doesn't work well.
my solution in simple:
foreach(around_enemy_arr in other)
{
vector a = normalize(self.positionvector - other.positionvector);
self.move_vector = self.move_vector + a;
}
this can work,but when plenty of enemies come very close to each other,they would shake.
i am sooooo confused.
please help.