basically if you want the enemy to be 100 units away from the player, u normalize the vector between them, and u will get like, for example, x = 0.7 and y = 0.3
0.7 + 0.3 = 1
you want the enemy to be 100 units away
x = 0.7 x 100
y = 0.3 x 100
or something like that and it will move away from u like magic.
to get X and y you do like (player.x + enemy.y) / distance(thingsgohere) and same for Y and u get ur two x and y to multiply the distance by or whatever
I think that'S how it works ???? and u get ur target move to location