How efficient do you want your code to be? If you don't use many enemies, maybe just let them c_scan (small range) each other periodically and if they detect each other; let them change their pan through vec_diff, vec_to_angle and my.pan.