i made an algorithm (but i like to call it an ai) that will avoid the enemys. this took about up to 3 - 4 hours (time i spent on the project) to perfect it. it still will die like if it goes in the corner and an enemys is near it. or its trapped between 2 enemys. if you use the code then GIVE ME CREDIT (wanted it to stick out) (even tho you could just make your own) but its a bit complex. (i got the idea from watching some ai videos)