Hello. Very often in games there is need to move object A to object B smoothly. Can this function be implemented in SFML? Something like this:
pointA.moveTo(pointB, 1f);
//=> pointA is now closer to pointB by 1 pixel
It's not so common to move by one pixel. And your solution wastes CPU cycles because you recompute (pointB - pointA) for every pixel to move.
What is more common is to store a velocity and compute the move with the elapsed time.
pointA += velocity * elapsed.asSeconds();