I guess that the purpose of this code is an enemy's constant speed approach to a player. The denominator of this code stands for the distance between a player and an enemy. When divide by zero error occurs, an enemy has already collided with a player.