Don't know if that helps. It calculates only the distance for the same height (y.coordinate are the same) of player and enemy.
Thanks a lot for your reply
but you misunderstand me probably because of my bad english
the blue object (player) never change position
the yellow object (ennemy) is changig position and spawning an arrow (bullet with gravity and speed)
i want to manipulate those (gravity,speed) in order that the arrow colloide everytime with the player (blue object) even if the ennemy (yellow) change position.