Hello, im working in a zombie survival game in wich the zombies chase the player.
I want to stop the zombies from overlapping themselves but i need help.
Here is the code of my Zombie class:
public void act()
{
chasePlayer();
eatPlayer();
}
public void chasePlayer()
{
turnTowards(Player.playerX, Player.playerY);
move(1);
}
public void eatPlayer()
{
Actor player;
player = getOneIntersectingObject(Player.class);
if(player != null)
{
getWorld().removeObject(player);
Player.Dead = true;
}
}
