@trollwarrior1, if you’re not going to politely reply to discussion, then I suggest not posting in a discussion forum. Name-calling is unnecessary, either way.
There is 0 path finding in here. Absolutely none. I’m too lazy to study A* path finding. This looks like path finding, but it isn’t. About zombies collision yea. It might take a lot of performance though.
Collision doesn’t take much performance really. Not with a simple circle or box. I recommend if you’re using libGdx to use the circle class, and check if the circles overlap each other, and if they do, don’t perform a movement. You can quickly iterate through your entities and check them with each other, it shouldn’t cause many problems. This might not be the best way, but it works. (If anyone has a better way, please do add it here.)
Imagine you’ve got two circles, a and b. If you want the two circles not to collide, you need to check whether the distance between the two circles is greater than the combined radii:
a.radius + b.radius < distance
So thats exactly what you do, let’s fill in the distance formular:
So what’s the problem with this? The problem is that [icode]sqrt()[/icode] is a (relatively) very slow operation. To get rid of it, simply take the square of the terms:
a.radius + b.radius < sqrt(dx * dx + dy * dy) <=> (a.radius + b.radius)² < dx * dx + dy * dy
And in the end that’s much faster. It might be premature optimization, but it takes almost no time to understand and change.