if the pig is on the edge of the map, it is impossible to complete the game. It might be worth making the pigs start walking in random directions after a certain amount of time.