Pathfinding of enemies and collision detection enhancement