HiIm doing a ball game and is working on the pass and shoot funktions.Right now im doing so that i have the ball x and y and while the ball hasent intesected with a player it moves 3 pixels in the dir towards the player. 3 pixels in x and 3 in y until the ball have the same x and y as the player.The problem is that this dont look nice at all.. the ball is moving werry bad.

I was woundering if anyone have a better idea in how to make this look better and natural.I have been thinking about using pytagoras mathematics to calculate the length of the hypotenusa(i spell bad i know ) and by that somehowe make the ball go 3 pixels on that line.. but the problem is in how to calculate the x and y to the endpoint..

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org