Yea I really wanted to shove as many zombies on screen as possible but I couldn't find a good way to still make it difficult and have them not all stack up so easily.
Possible options for a sequel!
I know it requires a bit of math, but you can add some math to their movement vector to have them spread out.
I don't know exactly how you did the movement, you may have used something prebuilt, but the math is rather simple.
let's say your target is at (x, y) position (20, 10) and your current zombie is at (5, 1) if the zombies movement is 5, it will calculate where to go like this.
You start by finding the distance between the two. SquareRoot( (20-5)^2 + (10 - 1)^2) Pythagorean theorem.
Your x, y movement vector might be this: movementVector = (20 - 5)/distance , (10 - 1)/distance.
This math gives you the direction, (0.86, 0.51) This is multiplied by speed to find where the next spot on the map to render the zombie is.
This is your current simple movement system, and causes the zombies to bunch up a lot. If you want them to spread out, we need to subtly effect this vector (0.86, 0.51).
Let's say we have a vector, or list, of 20 zombies. this is all the zombies on screen.
starting vector = (0.86, 0.51).
for each zombie in the list you would perform this process
Calculate the distance between the 2 zombies if this distance is less than 100 (the range you want them to start repulsing)
Calculate closeness = (100 - distance) / 100 ---- If they are 99 apart this number is 0.01, if they are 5 apart this number is 0.95
Calculate the vector as if your current zombie was trying to move toward the close zombie, use the same math from above.
Once you have the vector, let's say its (0.51, -0.86) You multiply it by -1, and then multiply it by your closeness let's say in this example 0.5
This gives you (-0.255, 0.43)
Add this new vector to your starting vector: (0.86, 0.51) + (-0.255, 0.43) = (0.605, 0.94)
This new vector moves towards your target zombie, but also away from the closeby zombie. Repeat the close zombie check for all zombies on screen, and the resulting vector will move towards the goal, but away from nearby zombies, and the closer another zombie is, the more it will want to move away from that zombie. Giving you the spreading out effect.